Hello community,

here is the log from the commit of package python3-ec2imgutils for 
openSUSE:Factory checked in at 2019-08-13 13:27:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-ec2imgutils (Old)
 and      /work/SRC/openSUSE:Factory/.python3-ec2imgutils.new.9556 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python3-ec2imgutils"

Tue Aug 13 13:27:33 2019 rev:4 rq:722911 version:7.0.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-ec2imgutils/python3-ec2imgutils.changes  
2018-12-21 08:21:50.741546037 +0100
+++ 
/work/SRC/openSUSE:Factory/.python3-ec2imgutils.new.9556/python3-ec2imgutils.changes
        2019-08-13 13:27:34.529318738 +0200
@@ -1,0 +2,7 @@
+Mon Aug  5 16:22:22 UTC 2019 - Robert Schweikert <[email protected]>
+
+- Update to version 7.0.5 (bsc#1144357, 1144358)
+  + Avoid name collision when creating a security group with a
+    generated nmae.
+
+-------------------------------------------------------------------

Old:
----
  ec2imgutils-7.0.4.tar.bz2

New:
----
  ec2imgutils-7.0.5.tar.bz2

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

Other differences:
------------------
++++++ python3-ec2imgutils.spec ++++++
--- /var/tmp/diff_new_pack.TGJ0I3/_old  2019-08-13 13:27:34.961318624 +0200
+++ /var/tmp/diff_new_pack.TGJ0I3/_new  2019-08-13 13:27:34.965318623 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python3-ec2imgutils
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 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
@@ -19,7 +19,7 @@
 %define upstream_name ec2imgutils
 
 Name:           python3-ec2imgutils
-Version:        7.0.4
+Version:        7.0.5
 Release:        0
 Summary:        Image management utilities for AWS EC2
 License:        GPL-3.0-or-later

++++++ ec2imgutils-7.0.4.tar.bz2 -> ec2imgutils-7.0.5.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ec2imgutils-7.0.4/ec2removeimg 
new/ec2imgutils-7.0.5/ec2removeimg
--- old/ec2imgutils-7.0.4/ec2removeimg  2018-12-19 15:46:59.583635530 +0100
+++ new/ec2imgutils-7.0.5/ec2removeimg  2019-08-05 18:19:57.561472390 +0200
@@ -164,7 +164,7 @@
     sys.exit(1)
 
 
-config_file = os.path.expanduser(args.configFilePath)
+config_file = os.path.expanduser(args.config_file_path)
 config = None
 if not os.path.isfile(config_file):
     print('Configuration file "%s" not found.' % config_file)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ec2imgutils-7.0.4/lib/ec2imgutils/VERSION 
new/ec2imgutils-7.0.5/lib/ec2imgutils/VERSION
--- old/ec2imgutils-7.0.4/lib/ec2imgutils/VERSION       2018-12-19 
15:46:59.467637924 +0100
+++ new/ec2imgutils-7.0.5/lib/ec2imgutils/VERSION       2019-08-05 
18:19:57.561472390 +0200
@@ -1 +1 @@
-7.0.4
+7.0.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ec2imgutils-7.0.4/lib/ec2imgutils/ec2imgutils.py 
new/ec2imgutils-7.0.5/lib/ec2imgutils/ec2imgutils.py
--- old/ec2imgutils-7.0.4/lib/ec2imgutils/ec2imgutils.py        2018-12-19 
15:46:59.487637510 +0100
+++ new/ec2imgutils-7.0.5/lib/ec2imgutils/ec2imgutils.py        2019-08-05 
18:19:57.561472390 +0200
@@ -44,7 +44,8 @@
                     service_name='ec2'
                 )
             else:
-                ec2 = boto3.client(
+                session = boto3.session.Session()
+                ec2 = session.client(
                     aws_access_key_id=self.access_key,
                     aws_secret_access_key=self.secret_key,
                     region_name=self.region,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ec2imgutils-7.0.4/lib/ec2imgutils/ec2setup.py 
new/ec2imgutils-7.0.5/lib/ec2imgutils/ec2setup.py
--- old/ec2imgutils-7.0.4/lib/ec2imgutils/ec2setup.py   2018-12-19 
15:46:59.499637264 +0100
+++ new/ec2imgutils-7.0.5/lib/ec2imgutils/ec2setup.py   2019-08-05 
18:19:57.561472390 +0200
@@ -1,4 +1,4 @@
-# Copyright (c) 2018 SUSE LLC
+# Copyright (c) 2019 SUSE LLC
 #
 # This file is part of ec2imgutils.
 #
@@ -19,9 +19,11 @@
 import random
 import datetime
 
+from tempfile import mkstemp, mkdtemp
+
+from botocore.exceptions import ClientError
+
 from ec2imgutils.ec2imgutils import EC2ImgUtils
-from tempfile import mkstemp
-from tempfile import mkdtemp
 
 
 class EC2Setup(EC2ImgUtils):
@@ -57,15 +59,25 @@
     def create_security_group(self, vpc_id=None):
         if self.verbose:
             print('Creating temporary security group')
-        group_name = 'ec2uploadimg-%s' % (random.randint(1, 100))
         group_description = 'ec2uploadimg created %s' % datetime.datetime.now()
         if not vpc_id:
             vpc_id = self.vpc_id
-        response = self._connect().create_security_group(
-            GroupName=group_name, Description=group_description,
-            VpcId=vpc_id
-        )
-
+        # Avoid name collisions
+        group_created = False
+        response = None
+        while not group_created:
+            group_name = 'ec2uploadimg-%s' % (random.randint(1, 100))
+            try:
+                response = self._connect().create_security_group(
+                    GroupName=group_name, Description=group_description,
+                    VpcId=vpc_id
+                )
+            except ClientError as e:
+                if not e.response['Error']['Code'] == 'InvalidGroup.Duplicate':
+                    raise e
+                # Generate a new group name and try again
+                continue
+            group_created = True
         self.security_group_id = response['GroupId']
         if self.verbose:
             print('Temporary Security Group Created %s in vpc %s'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ec2imgutils-7.0.4/man/man1/ec2uploadimg.1 
new/ec2imgutils-7.0.5/man/man1/ec2uploadimg.1
--- old/ec2imgutils-7.0.4/man/man1/ec2uploadimg.1       2018-12-19 
15:46:59.531636602 +0100
+++ new/ec2imgutils-7.0.5/man/man1/ec2uploadimg.1       2019-08-05 
18:19:57.561472390 +0200
@@ -94,6 +94,8 @@
 .IP "-m --machine ARCH"
 Specifies the architecture for the VM to be created. Supported values
 are
+.I arm64
+,
 .I i386
 or
 .I x86_64


Reply via email to