Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 7643f0c3f070d52835fec28a2433cbb9 > files > 7

euca2ools-1.3.1-10.fc13.src.rpm

--- euca2ools-1.3.1/bin/euca-bundle-image.inv-user	2010-09-04 08:01:51.000000000 -0500
+++ euca2ools-1.3.1/bin/euca-bundle-image	2010-11-18 13:26:16.508439936 -0600
@@ -153,12 +153,7 @@ def main():
     product_codes = None
     product_code_string = None
     if user_string:
-        try:
-            user = int(user_string)
-        except ValueError:
-            print 'Invalid user', user_string
-            sys.exit()
-        user = user_string
+        user = user_string.replace('-', '')
 
     for (name, value) in euca.opts:
         if name in ('-h', '--help'):
@@ -170,13 +165,7 @@ def main():
         elif name in ('-k', '--privatekey'):
             private_key_path = value
         elif name in ('-u', '--user'):
-            try:
-                value = value.replace('-', '')
-                user = int(value)
-            except ValueError:
-                print 'Invalid user', value
-                sys.exit()
-            user = value
+            user = value.replace('-', '')
         elif name == '--kernel':
             kernel = value
         elif name == '--ramdisk':
@@ -203,6 +192,11 @@ def main():
     if image_path and cert_path and private_key_path and user \
         and ec2cert_path:
         try:
+            int(user)
+        except ValueError:
+            print 'Invalid user', user
+            sys.exit(1)
+        try:
             euca.validate_file(image_path)
         except FileValidationError:
             print 'Invalid image'