Hello community,
here is the log from the commit of package python3-ec2imgutils for openSUSE:Factory checked in at 2018-12-04 20:55:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-ec2imgutils (Old)
and /work/SRC/openSUSE:Factory/.python3-ec2imgutils.new.19453 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-ec2imgutils"
Tue Dec 4 20:55:56 2018 rev:2 rq:653630 version:7.0.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-ec2imgutils/python3-ec2imgutils.changes 2018-11-14 14:43:13.898694077 +0100
+++ /work/SRC/openSUSE:Factory/.python3-ec2imgutils.new.19453/python3-ec2imgutils.changes 2018-12-04 20:56:20.212718819 +0100
@@ -1,0 +2,11 @@
+Fri Nov 16 16:38:59 UTC 2018 - Robert Schweikert
+
+- Fix build issue, tarball had missing files
+
+-------------------------------------------------------------------
+Thu Nov 15 19:03:48 UTC 2018 - Robert Schweikert
+
+- Update to version 7.0.3
+ + General improvements, latent bug fixes
+
+-------------------------------------------------------------------
Old:
----
ec2imgutils-7.0.2.tar.bz2
New:
----
ec2imgutils-7.0.3.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python3-ec2imgutils.spec ++++++
--- /var/tmp/diff_new_pack.Nh6hlz/_old 2018-12-04 20:56:20.684718299 +0100
+++ /var/tmp/diff_new_pack.Nh6hlz/_new 2018-12-04 20:56:20.688718294 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python3-ec2imgutils
#
-# Copyright (c) 2018 SUSE Linux GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,17 +12,17 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define upstream_name ec2imgutils
Name: python3-ec2imgutils
-Version: 7.0.2
+Version: 7.0.3
Release: 0
Summary: Image management utilities for AWS EC2
-License: GPL-3.0+
+License: GPL-3.0-or-later
Group: System/Management
Url: https://github.com/SUSE-Enceladus/ec2imgutils
Source0: %{upstream_name}-%{version}.tar.bz2
++++++ ec2imgutils-7.0.2.tar.bz2 -> ec2imgutils-7.0.3.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/Makefile new/ec2imgutils-7.0.3/Makefile
--- old/ec2imgutils-7.0.2/Makefile 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/Makefile 2018-11-16 17:37:56.519047319 +0100
@@ -3,7 +3,7 @@
NAME=ec2imgutils
MANPATH=/usr/share/man
dirs = lib man
-files = Makefile README.md LICENSE ec2deprecateimg ec2publishimg ec2removeimg ec2uploadimg setup.py
+files = Makefile README.md LICENSE ec2deprecateimg ec2publishimg ec2removeimg ec2uploadimg setup.py requirements-dev.txt requirements.txt
verSpec = $(shell rpm -q --specfile --qf '%{VERSION}' *.spec)
verSrc = $(shell cat lib/ec2imgutils/VERSION)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/README.md new/ec2imgutils-7.0.3/README.md
--- old/ec2imgutils-7.0.2/README.md 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/README.md 2018-11-16 17:37:56.519047319 +0100
@@ -1,11 +1,27 @@
+[![Build Status](https://www.travis-ci.com/SUSE-Enceladus/ec2imgutils.svg?branch=master)](https://www.travis-ci.com/SUSE-Enceladus/ec2imgutils)
+
ec2imgutils
===========
A collection of utilities for image management in AWS EC2
-Utilities:
+## Installation
+
+### openSUSE and SUSE Linux Enterprise
+
+```
+> zypper in python3-ec2imgutils
+```
+
+### PyPI
+
+```
+> pip install ec2imgutils
+```
-# ec2deprecateimg
+## Utilities
+
+### ec2deprecateimg
A command line utility to deprecate images in Amazon EC2. The platform does
not support a formal deprecation mechanism. The mechansim implemented by this
@@ -23,15 +39,38 @@
deprecation search criteria specified with _--image-name-frag_ or
_--image-name-match_ cannot match the replacement image.
+#### Usage
-# ec2publishimg
+```
+> ec2deprecateimg --account example --image-name-match v15 --image-virt-type hvm --replacement-name exampleimage_v16
+```
+
+See the [man pages](man/man1/ec2deprecateimg.1) for more information.
+
+```
+man ec2deprecateimg
+```
+
+### ec2publishimg
A command line utility to control the visibility of an image in AWS EC2.
The utility sets the visibility of an AMI to allow others to use the
image, making it public or sharing it with sepecific accounts, or setting
the image to private, i.e. only available to the account owner.
-# ec2removeimg
+#### Usage
+
+```
+> ec2publishimg --account example --image-name-match production-v2 --share-with all
+```
+
+See the [man pages](man/man1/ec2publishimg.1) for more information.
+
+```
+man ec2publishimg
+```
+
+### ec2removeimg
A command line utility to remove images in Amazon EC2. Removing an image,
in the sense that all traces of a given image are gone, means the image
@@ -40,7 +79,19 @@
the command line is a bookkeeping annoyance. This tool handles the clean up
of images.
-# ec2uploadimg
+#### Usage
+
+```
+> ec2removeimg --account example --image-name-match v15
+```
+
+See the [man pages](man/man1/ec2uploadimg.1) for more information.
+
+```
+man ec2removeimg
+```
+
+### ec2uploadimg
A command line utility to upload a compressed raw image file, as created by
KIWI for example to Amazon EC2 and create a snapshot or register an EBS
@@ -61,38 +112,14 @@
* Register a new AMI
* Clean up
-
-## Installation
-
-### openSUSE and SUSE Linux Enterprise
+#### Usage
```
-zypper in python3-ec2imgutils
+> ec2uploadimg --account example -d "My first image" -m x86_64 -n my_linux_image -r us-east-1 PATH_TO_COMPRESSED_FILE
```
-## Usage
+See the [man pages](man/man1/ec2uploadimg.1) for more information.
```
-ec2deprecateimg --account example --image-name-match v15 --image-virt-type hvm --replacement-name exampleimage_v16
-
-ec2publishimg --account example --image-name-match production-v2 --share-with all
-
-ec2removeimg --account example --image-name-match v15
-
-ec2uploadimg --account example -d "My first image" -m x86_64 -n my_linux_image -r us-east-1 PATH_TO_COMPRESSED_FILE
-```
-
-
-See the man pages for more information:
-
-* [ec2deprecateimg](man/man1/ec2deprecateimg.1)
-* [ec2publishimg](man/man1/ec2publishimg.1)
-* [ec2removeimg](man/man1/ec2removeimg.1)
-* [ec2uploadimg](man/man1/ec2uploadimg.1)
-
-```
-man ec2deprecateimg
-man ec2publishimg
-man ec2removeimg
man ec2uploadimg
```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/ec2deprecateimg new/ec2imgutils-7.0.3/ec2deprecateimg
--- old/ec2imgutils-7.0.2/ec2deprecateimg 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/ec2deprecateimg 2018-11-16 17:37:56.519047319 +0100
@@ -17,7 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with ec2deprecateimg. If not, see http://www.gnu.org/licenses/.
-import boto3
import argparse
import os
import sys
@@ -66,7 +65,7 @@
)
argparse.add_argument(
'-f', '--file',
- default=os.sep.join(['~','.ec2utils.conf']),
+ default=os.sep.join(['~', '.ec2utils.conf']),
dest='configFilePath',
help='Path to configuration file, default ~/.ec2utils.conf (Optional)',
metavar='CONFIG_FILE'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/ec2publishimg new/ec2imgutils-7.0.3/ec2publishimg
--- old/ec2imgutils-7.0.2/ec2publishimg 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/ec2publishimg 2018-11-16 17:37:56.519047319 +0100
@@ -62,7 +62,7 @@
)
argparse.add_argument(
'-f', '--file',
- default=os.sep.join(['~','.ec2utils.conf']),
+ default=os.sep.join(['~', '.ec2utils.conf']),
dest='configFilePath',
help='Path to configuration file, default ~/.ec2utils.conf (Optional)',
metavar='CONFIG_FILE'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/ec2removeimg new/ec2imgutils-7.0.3/ec2removeimg
--- old/ec2imgutils-7.0.2/ec2removeimg 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/ec2removeimg 2018-11-16 17:37:56.531047064 +0100
@@ -60,7 +60,7 @@
)
argparse.add_argument(
'-f', '--file',
- default=os.sep.join(['~','.ec2utils.conf']),
+ default=os.sep.join(['~', '.ec2utils.conf']),
dest='config_file_path',
help='Path to configuration file, default ~/.ec2utils.conf (Optional)',
metavar='CONFIG_FILE'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/ec2uploadimg new/ec2imgutils-7.0.3/ec2uploadimg
--- old/ec2imgutils-7.0.2/ec2uploadimg 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/ec2uploadimg 2018-11-16 17:37:56.531047064 +0100
@@ -17,7 +17,6 @@
# You should have received a copy of the GNU General Public License
# along with ec2uploadimg. If not, see http://www.gnu.org/licenses/.
-import configparser
import argparse
import boto3
import os
@@ -26,11 +25,15 @@
import ec2imgutils.ec2utils as utils
import ec2imgutils.ec2uploadimg as ec2upimg
-from ec2imgutils.ec2imgutilsExceptions import *
+from ec2imgutils.ec2imgutilsExceptions import (
+ EC2AccountException,
+ EC2UploadImgException
+)
from ec2imgutils.ec2setup import EC2Setup
aborted = False
+
def signal_handler(signum, frame):
global aborted
if aborted:
@@ -46,6 +49,7 @@
# and we just exit
sys.exit(1)
+
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
@@ -104,7 +108,7 @@
)
argparse.add_argument(
'-f', '--file',
- default=os.sep.join(['~','.ec2utils.conf']),
+ default=os.sep.join(['~', '.ec2utils.conf']),
dest='configFilePath',
help='Path to configuration file, default ~/.ec2utils.conf (Optional)',
metavar='CONFIG_FILE'
@@ -593,33 +597,33 @@
if not aborted:
uploader = ec2upimg.EC2ImageUploader(
- access_key=access_key,
- backing_store=args.backingStore,
- billing_codes=args.billingCodes,
- bootkernel=bootkernel,
- ena_support=args.ena,
- image_arch=args.arch,
- image_description=args.descript,
- image_name=args.imgName,
- image_virt_type=virtualization_type,
- inst_user_name=ssh_user,
- launch_ami=ami_id,
- launch_inst_type=inst_type,
- region=region,
- root_volume_size=root_volume_size,
- running_id=running_id,
- secret_key=secret_key,
- security_group_ids=security_group_ids,
- session_token=args.sessionToken,
- sriov_type=sriov_type,
- ssh_key_pair_name=key_pair_name,
- ssh_key_private_key_file=ssh_private_key_file,
- ssh_timeout=args.sshTimeout,
- use_grub2=args.grub2,
- use_private_ip=args.usePrivateIP,
- verbose=args.verbose,
- vpc_subnet_id=vpc_subnet_id,
- wait_count=args.waitCount
+ access_key=access_key,
+ backing_store=args.backingStore,
+ billing_codes=args.billingCodes,
+ bootkernel=bootkernel,
+ ena_support=args.ena,
+ image_arch=args.arch,
+ image_description=args.descript,
+ image_name=args.imgName,
+ image_virt_type=virtualization_type,
+ inst_user_name=ssh_user,
+ launch_ami=ami_id,
+ launch_inst_type=inst_type,
+ region=region,
+ root_volume_size=root_volume_size,
+ running_id=running_id,
+ secret_key=secret_key,
+ security_group_ids=security_group_ids,
+ session_token=args.sessionToken,
+ sriov_type=sriov_type,
+ ssh_key_pair_name=key_pair_name,
+ ssh_key_private_key_file=ssh_private_key_file,
+ ssh_timeout=args.sshTimeout,
+ use_grub2=args.grub2,
+ use_private_ip=args.usePrivateIP,
+ verbose=args.verbose,
+ vpc_subnet_id=vpc_subnet_id,
+ wait_count=args.waitCount
)
if args.snapOnly:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/lib/ec2imgutils/VERSION new/ec2imgutils-7.0.3/lib/ec2imgutils/VERSION
--- old/ec2imgutils-7.0.2/lib/ec2imgutils/VERSION 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/lib/ec2imgutils/VERSION 2018-11-16 17:37:56.519047319 +0100
@@ -1 +1 @@
-7.0.2
+7.0.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2deprecateimg.py new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2deprecateimg.py
--- old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2deprecateimg.py 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2deprecateimg.py 2018-11-16 17:37:56.519047319 +0100
@@ -15,10 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with ec2deprecateimg. If not, see http://www.gnu.org/licenses/.
-import boto3
import datetime
import dateutil.relativedelta
-import re
import ec2imgutils.ec2utils as utils
from ec2imgutils.ec2imgutils import EC2ImgUtils
@@ -130,7 +128,7 @@
continue
if self.image_virt_type:
if self.image_virt_type == image['VirtualizationType']:
- images.append(img)
+ images.append(image)
else:
continue
if self.public_only:
@@ -151,7 +149,6 @@
def _get_images_to_deprecate(self):
"""Find images to deprecate"""
images = None
- condition = None
if self.deprecation_image_id:
images = self._find_images_by_id(self.deprecation_image_id, True)
elif self.deprecation_image_name:
@@ -266,7 +263,9 @@
removal_date_data,
replacement_image_data
]
- self._connect().create_tags(Resources=[image['ImageId']], Tags=tags)
+ self._connect().create_tags(
+ Resources=[image['ImageId']], Tags=tags
+ )
if self.verbose:
print('\t\ttagged:%s\t%s' % (image['ImageId'], image['Name']))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2imgutils.py new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2imgutils.py
--- old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2imgutils.py 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2imgutils.py 2018-11-16 17:37:56.519047319 +0100
@@ -16,8 +16,6 @@
# along with ec2imgutils.ase. If not, see http://www.gnu.org/licenses/.
import boto3
-import configparser
-import os
from ec2imgutils.ec2imgutilsExceptions import EC2ConnectionException
@@ -68,7 +66,7 @@
return self._connect().describe_images(Owners=['self'])['Images']
# ---------------------------------------------------------------------
- def _set_access_keys():
+ def _set_access_keys(self):
"""Set the access keys for the connection"""
if not self.access_key:
self.access_key = self.config.get_option(self.account,
@@ -85,7 +83,7 @@
if self.verbose:
print('Using EC2 region: ', region)
-
+
self.region = region
return True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2imgutilsExceptions.py new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2imgutilsExceptions.py
--- old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2imgutilsExceptions.py 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2imgutilsExceptions.py 2018-11-16 17:37:56.519047319 +0100
@@ -35,8 +35,10 @@
class EC2PublishImgException(Exception):
pass
+
class EC2RemoveImgException(Exception):
pass
+
class EC2UploadImgException(Exception):
pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2publishimg.py new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2publishimg.py
--- old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2publishimg.py 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2publishimg.py 2018-11-16 17:37:56.519047319 +0100
@@ -15,9 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with ec2publishimg. If not, see http://www.gnu.org/licenses/.
-import boto3
-import re
-
import ec2imgutils.ec2utils as utils
from ec2imgutils.ec2imgutils import EC2ImgUtils
from ec2imgutils.ec2imgutilsExceptions import EC2PublishImgException
@@ -75,7 +72,7 @@
return utils.find_images_by_name_regex_match(
owned_images,
self.image_name_match)
- except:
+ except Exception:
msg = 'Unable to complie regular expression "%s"'
msg = msg % self.image_name_match
raise EC2PublishImgException(msg)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2removeimg.py new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2removeimg.py
--- old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2removeimg.py 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2removeimg.py 2018-11-16 17:37:56.519047319 +0100
@@ -15,14 +15,13 @@
# You should have received a copy of the GNU General Public License
# along with ec2publishimg. If not, see http://www.gnu.org/licenses/.
-import boto3
-import re
import time
import ec2imgutils.ec2utils as utils
from ec2imgutils.ec2imgutils import EC2ImgUtils
from ec2imgutils.ec2imgutilsExceptions import EC2RemoveImgException
+
class EC2RemoveImage(EC2ImgUtils):
"""Remove images from EC2."""
@@ -57,7 +56,7 @@
"""Check if the images found meet operating conditions:
If all is true we delete all found images if not we should have
found only one image"""
-
+
if not images:
print('No images to remove found in region', self.region)
@@ -86,7 +85,7 @@
return utils.find_images_by_name_regex_match(
owned_images,
self.image_name_match)
- except:
+ except Exception:
msg = 'Unable to complie regular expression "%s"'
msg = msg % self.image_name_match
raise EC2RemoveImgException(msg)
@@ -105,11 +104,11 @@
# The image snapshot should be the first device
ebs_info = device_map[0].get('Ebs')
if not ebs_info:
- error_msg = 'Image "%s" is not EBS backed' % image.get('Name')
+ error_msg = 'Image "%s" is not EBS backed' % image.get('Name')
raise EC2RemoveImgException(error_msg)
snapshot_id = ebs_info.get('SnapshotId')
if not snapshot_id:
- error_msg = 'No snapshot found for image "%s"' % image.get('Name')
+ error_msg = 'No snapshot found for image "%s"' % image.get('Name')
raise EC2RemoveImgException(error_msg)
return snapshot_id
@@ -123,7 +122,7 @@
# While the boundary conditions are not met, we are just printing
# information thus this is not considered a failure
return True
-
+
header_msg = 'Would remove image '
if not self.keep_snap:
header_msg += 'and snapshot '
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2setup.py new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2setup.py
--- old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2setup.py 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2setup.py 2018-11-16 17:37:56.519047319 +0100
@@ -15,12 +15,10 @@
# You should have received a copy of the GNU General Public License
# along with ec2imgutils.ase. If not, see http://www.gnu.org/licenses/.
-import boto3
import os
import random
import datetime
-from ec2imgutils.ec2imgutilsExceptions import EC2ConnectionException
from ec2imgutils.ec2imgutils import EC2ImgUtils
from tempfile import mkstemp
from tempfile import mkdtemp
@@ -72,7 +70,7 @@
if self.verbose:
print('Temporary Security Group Created %s in vpc %s'
% (self.security_group_id, vpc_id))
- data = self._connect().authorize_security_group_ingress(
+ self._connect().authorize_security_group_ingress(
GroupId=self.security_group_id,
IpPermissions=[
{'IpProtocol': 'tcp',
@@ -172,7 +170,7 @@
# ---------------------------------------------------------------------
def _remove_security_group(self):
- response = self._connect().delete_security_group(
+ self._connect().delete_security_group(
GroupId=self.security_group_id
)
if self.verbose:
@@ -183,7 +181,7 @@
def _remove_upload_key_pair(self):
if self.verbose:
print('Deleting temporary key pair ', self.key_pair_name)
- secret_key = self._connect().delete_key_pair(
+ self._connect().delete_key_pair(
KeyName=self.key_pair_name)
if os.path.isfile(self.ssh_private_key_file):
os.remove(self.ssh_private_key_file)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2uploadimg.py new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2uploadimg.py
--- old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2uploadimg.py 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2uploadimg.py 2018-11-16 17:37:56.519047319 +0100
@@ -15,10 +15,8 @@
# You should have received a copy of the GNU General Public License
# along with ec2uploadimg. If not, see http://www.gnu.org/licenses/.
-import boto3
import os
import paramiko
-import string
import sys
import threading
import time
@@ -102,9 +100,14 @@
self.aborted = False
def abort(self):
- """Set the abort flag to take appropriate action and stop image creation"""
+ """
+ Set the abort flag to take appropriate action and stop image creation.
+ """
if self.verbose:
- print("Aborted upload, please wait while AWS resources get cleaned up. This may take a few minutes!")
+ print(
+ "Aborted upload, please wait while AWS resources get cleaned"
+ " up. This may take a few minutes!"
+ )
self.aborted = True
# ---------------------------------------------------------------------
@@ -136,7 +139,7 @@
}
]
)
- except:
+ except Exception:
wait_status = 1
if self.verbose:
self.progress_timer.cancel()
@@ -154,7 +157,7 @@
command = 'chmod %s %s' % (permissions, target)
result = self._execute_ssh_command(command)
- return 1
+ return result
# ---------------------------------------------------------------------
def _check_image_exists(self):
@@ -172,7 +175,7 @@
self._connect().describe_security_groups(
GroupIds=self.security_group_ids.split(',')
)
- except:
+ except Exception:
error_msg = 'One or more of the specified security groups '
error_msg += 'could not be found: %s' % self.security_group_ids
raise EC2UploadImgException(error_msg)
@@ -183,7 +186,7 @@
exists"""
try:
self._connect().describe_subnets(SubnetIds=[self.vpc_subnet_id])
- except:
+ except Exception:
error_msg = 'Specified subnet %s not found' % self.vpc_subnet_id
raise EC2UploadImgException(error_msg)
@@ -259,7 +262,7 @@
}
]
)
- except:
+ except Exception:
wait_status = 1
if self.verbose:
self.progress_timer.cancel()
@@ -369,7 +372,7 @@
}
]
)
- except:
+ except Exception:
wait_status = 1
if self.verbose:
self.progress_timer.cancel()
@@ -390,7 +393,7 @@
command = 'mkfs -t ext3 %s' % filesystem_partition
result = self._execute_ssh_command(command)
- return 1
+ return result
# ---------------------------------------------------------------------
def _create_storge_volume(self):
@@ -433,7 +436,7 @@
}
]
)
- except:
+ except Exception:
wait_status = 1
if self.verbose:
self.progress_timer.cancel()
@@ -477,7 +480,7 @@
}
]
)
- except:
+ except Exception:
wait_status = 1
if self.verbose:
self.progress_timer.cancel()
@@ -521,7 +524,7 @@
target_root_device)
result = self._execute_ssh_command(command)
- return 1
+ return result
# ---------------------------------------------------------------------
def _end_ssh_session(self):
@@ -575,7 +578,7 @@
username=self.inst_user_name,
hostname=instance_ip
)
- except:
+ except Exception:
if self.verbose:
print('. ', end=' ')
sys.stdout.flush()
@@ -612,7 +615,7 @@
if cmd_error:
self._clean_up()
msg = 'Execution of "%s" failed with the following error' % command
- msg += '\n%s' % cmd_err
+ msg += '\n%s' % cmd_error
raise EC2UploadImgException(msg)
return stdout.read().strip().decode('utf-8')
@@ -641,7 +644,7 @@
if self.verbose:
print('Formating storage volume')
parted = self._get_command_from_instance('parted')
- sfdifk = None
+ sfdisk = None
if not parted:
sfdisk = self._get_command_from_instance('sfdisk')
@@ -666,7 +669,7 @@
command = '%s %s < /tmp/partition.txt' % (sfdisk, device_id)
result = self._execute_ssh_command(command)
- return 1
+ return result
# ---------------------------------------------------------------------
def _get_command_from_instance(self, command):
@@ -750,7 +753,7 @@
}
]
)
- except:
+ except Exception:
wait_status = 1
if self.verbose:
self.progress_timer.cancel()
@@ -768,7 +771,7 @@
mount_point = '/mnt'
mount_device = '%s1' % device_id
command = 'mount %s %s' % (mount_device, mount_point)
- result = self._execute_ssh_command(command)
+ self._execute_ssh_command(command)
return mount_point
@@ -861,9 +864,9 @@
try:
if self.verbose:
print('Uploading image file: ', source)
- sftp_attrs = sftp.put(source,
- '%s/%s' % (target_dir, filename),
- self._upload_progress)
+ sftp.put(source,
+ '%s/%s' % (target_dir, filename),
+ self._upload_progress)
if self.verbose:
print()
except Exception as e:
@@ -908,7 +911,7 @@
if self.verbose:
print('Inflating image: ', fl)
command = 'xz -d %s/%s' % (image_dir, fl)
- result = self._execute_ssh_command(command)
+ self._execute_ssh_command(command)
raw_image_file = fl.strip()[:-3]
break
if fl.strip()[-4:] == '.raw':
@@ -956,7 +959,7 @@
}
]
)
- except:
+ except Exception:
wait_status = 1
if self.verbose:
self.progress_timer.cancel()
@@ -1029,7 +1032,7 @@
}
]
)
- except:
+ except Exception:
wait_status = 1
if self.verbose:
self.progress_timer.cancel()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2utils.py new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2utils.py
--- old/ec2imgutils-7.0.2/lib/ec2imgutils/ec2utils.py 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/lib/ec2imgutils/ec2utils.py 2018-11-16 17:37:56.519047319 +0100
@@ -136,7 +136,7 @@
parsed = None
try:
parsed = config.read(configFilePath)
- except:
+ except Exception:
msg = 'Could not parse configuration file "%s"\n' % configFilePath
e_type, value, tb = sys.exc_info()
msg += format(value)
@@ -167,7 +167,7 @@
account_name = generate_config_account_name(account)
try:
value = config.get(account_name, entry)
- except:
+ except Exception:
msg = 'Unable to get %s value from account section %s'
raise EC2AccountException(msg % (entry, account))
@@ -217,5 +217,5 @@
def validate_account_numbers(share_with):
accounts = list(filter(None, share_with.split(',')))
if accounts:
- return all(map(re.match, repeat('^\d{12}$'), accounts))
+ return all(map(re.match, repeat(r'^\d{12}$'), accounts))
return False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/requirements-dev.txt new/ec2imgutils-7.0.3/requirements-dev.txt
--- old/ec2imgutils-7.0.2/requirements-dev.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/ec2imgutils-7.0.3/requirements-dev.txt 2018-11-16 17:37:56.531047064 +0100
@@ -0,0 +1,5 @@
+-r requirements-test.txt
+
+pytest
+flake8
+bumpversion
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/requirements.txt new/ec2imgutils-7.0.3/requirements.txt
--- old/ec2imgutils-7.0.2/requirements.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/ec2imgutils-7.0.3/requirements.txt 2018-11-16 17:37:56.531047064 +0100
@@ -0,0 +1,3 @@
+boto3>=1.4.1
+paramiko
+python-dateutil
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ec2imgutils-7.0.2/setup.py new/ec2imgutils-7.0.3/setup.py
--- old/ec2imgutils-7.0.2/setup.py 2018-11-09 20:22:57.970357581 +0100
+++ new/ec2imgutils-7.0.3/setup.py 2018-11-16 17:37:56.531047064 +0100
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with ec2utilsbase. If not, see http://www.gnu.org/licenses/.
+# along with ec2imgutils. If not, see http://www.gnu.org/licenses/.
import sys
@@ -28,21 +28,26 @@
version = open('lib/ec2imgutils/VERSION').read().strip()
-requires = [
- 'boto3>=1.4.1',
- 'paramiko',
- 'python-dateutil',
-]
+with open('requirements.txt') as req_file:
+ requirements = req_file.read().splitlines()
+
+with open('requirements-dev.txt') as req_file:
+ dev_requirements = req_file.read().splitlines()[2:]
if __name__ == '__main__':
setuptools.setup(
name='ec2imgutils',
description=(
- 'Command-line tools to manage images in AWS EC2'),
+ 'Command-line tools to manage images in AWS EC2'
+ ),
long_description=open('README.md').read(),
- url='https://github.com/SUSE-Enceladus/tree/master/ec2imgutils',
+ long_description_content_type="text/markdown",
+ url='https://github.com/SUSE-Enceladus/ec2imgutils',
license='GPLv3+',
- install_requires=requires,
+ install_requires=requirements,
+ extras_require={
+ 'dev': dev_requirements
+ },
author='SUSE Public Cloud Team',
author_email='public-cloud-dev@susecloud.net',
version=version,
@@ -61,7 +66,8 @@
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Natural Language :: English',
- 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
+ 'License :: OSI Approved :: '
+ 'GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',