Hello community,

here is the log from the commit of package python3-ec2uploadimg for 
openSUSE:Factory checked in at 2018-02-24 16:39:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-ec2uploadimg (Old)
 and      /work/SRC/openSUSE:Factory/.python3-ec2uploadimg.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-ec2uploadimg"

Sat Feb 24 16:39:27 2018 rev:4 rq:579662 version:6.0.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/python3-ec2uploadimg/python3-ec2uploadimg.changes    
    2018-02-06 16:49:31.987004432 +0100
+++ 
/work/SRC/openSUSE:Factory/.python3-ec2uploadimg.new/python3-ec2uploadimg.changes
   2018-02-24 16:39:34.257036156 +0100
@@ -1,0 +2,7 @@
+Fri Feb 23 20:55:56 UTC 2018 - [email protected]
+
+- Update to version 6.0.1
+  + Create a security group if necessary in the proper VPC
+  + Read the security group to use form the configuration file
+
+-------------------------------------------------------------------

Old:
----
  ec2uploadimg-6.0.0.tar.bz2

New:
----
  ec2uploadimg-6.0.1.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python3-ec2uploadimg.spec ++++++
--- /var/tmp/diff_new_pack.0YFhzI/_old  2018-02-24 16:39:34.933011829 +0100
+++ /var/tmp/diff_new_pack.0YFhzI/_new  2018-02-24 16:39:34.937011685 +0100
@@ -18,10 +18,10 @@
 
 %define upstream_name ec2uploadimg
 Name:           python3-ec2uploadimg
-Version:        6.0.0
+Version:        6.0.1
 Release:        0
 Summary:        Upload an image to EC2
-License:        GPL-3.0+
+License:        GPL-3.0-or-later
 Group:          System/Management
 Url:            https://github.com/SUSE/Enceladus
 Source0:        %{upstream_name}-%{version}.tar.bz2

++++++ ec2uploadimg-6.0.0.tar.bz2 -> ec2uploadimg-6.0.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ec2uploadimg-6.0.0/ec2uploadimg 
new/ec2uploadimg-6.0.1/ec2uploadimg
--- old/ec2uploadimg-6.0.0/ec2uploadimg 2018-02-05 22:13:08.980943110 +0100
+++ new/ec2uploadimg-6.0.1/ec2uploadimg 2018-02-23 21:18:01.023244439 +0100
@@ -236,8 +236,8 @@
     dest='version',
     help='Program version'
 )
-help_msg = 'The ID of the VPC subnet in which the helper instance should '
-help_msg += 'run (Optional)'
+help_msg = 'The ID, starts with "subnet-" of the VPC subnet in which the '
+help_msg += 'helper instance should run (Optional)'
 argparse.add_argument(
     '--vpc-subnet-id',
     default='',
@@ -374,7 +374,7 @@
                                                    region,
                                                    'ami',
                                                    '--ec2-ami')
-                except:
+                except Exception:
                     print('Could not determine helper AMI-ID', file=sys.stderr)
                     sys.exit(1)
             bootkernel = args.akiID
@@ -389,7 +389,7 @@
                                                            region,
                                                            'g2_aki_x86_64',
                                                            '--boot-kernel')
-                    except:
+                    except Exception:
                         print(
                             'Could not find bootkernel in config',
                             file=sys.stderr
@@ -402,7 +402,7 @@
                                                            region,
                                                            'aki_x86_64',
                                                            '--boot-kernel')
-                    except:
+                    except Exception:
                         print(
                             'Could not find bootkernel in config',
                             file=sys.stderr
@@ -415,7 +415,7 @@
                                                            region,
                                                            'aki_i386',
                                                            '--boot-kernel')
-                    except:
+                    except Exception:
                         print(
                             'Could not find bootkernel in config',
                             file=sys.stderr
@@ -428,7 +428,11 @@
                         file=sys.stderr
                     )
                     print('bootkernel to use ', file=sys.stderr)
-                    print('must specify bootkernel, ', end=' ', 
file=sys.stderr)
+                    print(
+                        'must specify bootkernel, ',
+                        end=' ',
+                        file=sys.stderr
+                    )
                     print('arch (x86_64|i386) or hvm', file=sys.stderr)
                     sys.exit(1)
 
@@ -443,10 +447,10 @@
             key_pair_name = args.sshName
             ssh_private_key_file = args.privateKey
             if (
-                not key_pair_name
-                and not ssh_private_key_file
-                and not args.accountName
-               ):
+                    not key_pair_name
+                    and not ssh_private_key_file
+                    and not args.accountName
+            ):
                 key_pair_name, ssh_private_key_file = \
                     setup.create_upload_key_pair()
             if not key_pair_name:
@@ -460,11 +464,13 @@
                 sys.exit(1)
 
             if not ssh_private_key_file:
-                ssh_private_key_file = utils.get_from_config(args.accountName,
-                                                             config,
-                                                             region,
-                                                             'ssh_private_key',
-                                                             
'--private-key-file')
+                ssh_private_key_file = utils.get_from_config(
+                    args.accountName,
+                    config,
+                    region,
+                    'ssh_private_key',
+                    '--private-key-file'
+                )
 
             if not ssh_private_key_file:
                 print(
@@ -500,17 +506,20 @@
                 vpc_subnet_id = setup.create_vpc_subnet()
             if not vpc_subnet_id and not (args.amiID or args.runningID):
                 # Depending on instance type an instance may possibly only
-                # launch inside a subnet. Look in the config for a subnet if 
none
-                # is given and the AMI to use was not specified on the command 
line
+                # launch inside a subnet. Look in the config for a subnet if
+                # no subnet ID is given and the AMI to use was not
+                # specified on the command line
                 try:
-                    vpc_subnet_id = utils.get_from_config(args.accountName,
-                                                          config,
-                                                          region,
-                                                          'subnet_id_%s' % 
region,
-                                                          '--vpc-subnet-id')
+                    vpc_subnet_id = utils.get_from_config(
+                        args.accountName,
+                        config,
+                        region,
+                        'subnet_id_%s' % region,
+                        '--vpc-subnet-id'
+                    )
                     if args.verbose and vpc_subnet_id:
                         print('Using VPC subnet: %s' % vpc_subnet_id)
-                except:
+                except Exception:
                     if args.verbose:
                         msg = 'Not using a subnet-id, none given on the '
                         msg += 'command line and none found in config for '
@@ -519,7 +528,47 @@
 
             security_group_ids = args.securityGroupIds
             if not security_group_ids:
-                security_group_ids = setup.create_security_group()
+                if not args.accountName:
+                    security_group_ids = setup.create_security_group()
+                else:
+                    try:
+                        security_group_ids = utils.get_from_config(
+                            args.accountName,
+                            config,
+                            region,
+                            'security_group_ids_%s' % region,
+                            '--security-group-ids'
+                        )
+                        if args.verbose and security_group_ids:
+                            msg = 'Using Security Group IDs: %s'
+                            print(msg % security_group_ids)
+                    except Exception:
+                        if args.verbose:
+                            msg = 'No security group specified in the '
+                            msg += 'configuration, "security_group_ids_%s" or '
+                            msg += 'given on the command line.'
+                            print(msg % region)
+                    if not security_group_ids and vpc_subnet_id:
+                        ec2 = boto3.client(
+                            aws_access_key_id=access_key,
+                            aws_secret_access_key=secret_key,
+                            region_name=region,
+                            service_name='ec2'
+                        )
+                        subnet_data = ec2.describe_subnets(
+                            SubnetIds=[vpc_subnet_id]
+                        )
+                        subnets = subnet_data.get('Subnets')
+                        if not subnets:
+                            msg = 'Unable to obtain VPC information for '
+                            msg += 'provided subnet "%s". ' % vpc_subnet_id
+                            msg += 'Subnet ID is invalid.'
+                            print(msg, file=sys.stderr)
+                            sys.exit(1)
+                        vpc_id = subnets[0]['VpcId']
+                        security_group_ids = setup.create_security_group(
+                            vpc_id
+                        )
 
             uploader = ec2upimg.EC2ImageUploader(
                               access_key=access_key,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ec2uploadimg-6.0.0/lib/ec2utils/upload_VERSION 
new/ec2uploadimg-6.0.1/lib/ec2utils/upload_VERSION
--- old/ec2uploadimg-6.0.0/lib/ec2utils/upload_VERSION  2018-02-05 
22:13:08.956943617 +0100
+++ new/ec2uploadimg-6.0.1/lib/ec2utils/upload_VERSION  2018-02-23 
21:18:01.023244439 +0100
@@ -1 +1 @@
-6.0.0
+6.0.1


Reply via email to