[euca2ools] Fix registration of EBS-backed images

gholms gholms at fedoraproject.org
Tue Jul 26 20:46:29 UTC 2011


commit 0e7f3c553d4b4d8b1f61375d144fd8532bb33f55
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Fri Jul 22 17:56:36 2011 -0700

    Fix registration of EBS-backed images

 euca2ools-1.3.1-ebsreg.patch |   81 ++++++++++++++++++++++++++++++++++++++++++
 euca2ools.spec               |    9 ++++-
 2 files changed, 89 insertions(+), 1 deletions(-)
---
diff --git a/euca2ools-1.3.1-ebsreg.patch b/euca2ools-1.3.1-ebsreg.patch
new file mode 100644
index 0000000..4460935
--- /dev/null
+++ b/euca2ools-1.3.1-ebsreg.patch
@@ -0,0 +1,81 @@
+Index: euca2ools-1.3/bin/euca-register
+===================================================================
+--- euca2ools-1.3.orig/bin/euca-register
++++ euca2ools-1.3/bin/euca-register
+@@ -47,6 +47,7 @@ euca-register [-h, --help] [--version] [
+ REQUIRED PARAMETERS
+ 	
+ image_location - path to the uploaded image (bucket/manifest).
++                 (Required if registering an S3-based image)
+ 
+ OPTIONAL PARAMETERS
+ 
+@@ -133,39 +134,35 @@ def main():
+         image_location = arg
+         break
+ 
+-    if image_location:
+-        try:
+-            euca_conn = euca.make_connection()
+-        except ConnectionFailed, e:
+-            print e.message
+-            sys.exit(1)
+-        if snapshot:
+-            if not root_device_name:
+-                root_device_name = '/dev/sda1'
+-            block_device_map_args.append('%s=%s' % (root_device_name,
+-                    snapshot))
+-        if block_device_map_args:
+-            block_device_map = \
+-                euca.parse_block_device_args(block_device_map_args)
+-        try:
+-            image_id = euca_conn.register_image(
+-                name=image_name,
+-                description=description,
+-                image_location=image_location,
+-                architecture=architecture,
+-                kernel_id=kernel,
+-                ramdisk_id=ramdisk,
+-                root_device_name=root_device_name,
+-                block_device_map=block_device_map,
+-                )
+-        except Exception, ex:
+-            euca.display_error_and_exit('%s' % ex)
+-
+-        if image_id:
+-            print 'IMAGE\t%s' % image_id
+-    else:
+-        print 'image location must be specified'
+-        usage()
++    try:
++        euca_conn = euca.make_connection()
++    except ConnectionFailed, e:
++        print e.message
++        sys.exit(1)
++    if snapshot:
++        if not root_device_name:
++            root_device_name = '/dev/sda1'
++        block_device_map_args.append('%s=%s' % (root_device_name,
++                snapshot))
++    if block_device_map_args:
++        block_device_map = \
++            euca.parse_block_device_args(block_device_map_args)
++    try:
++        image_id = euca_conn.register_image(
++            name=image_name,
++            description=description,
++            image_location=image_location,
++            architecture=architecture,
++            kernel_id=kernel,
++            ramdisk_id=ramdisk,
++            root_device_name=root_device_name,
++            block_device_map=block_device_map,
++            )
++    except Exception, ex:
++        euca.display_error_and_exit('%s' % ex)
++
++    if image_id:
++        print 'IMAGE\t%s' % image_id
+ 
+ 
+ if __name__ == '__main__':
diff --git a/euca2ools.spec b/euca2ools.spec
index 7909c68..1f8be6e 100644
--- a/euca2ools.spec
+++ b/euca2ools.spec
@@ -4,7 +4,7 @@
 
 Name:           euca2ools
 Version:        1.3.1
-Release:        11%{?dist}
+Release:        12%{?dist}
 Summary:        Elastic Utility Computing Architecture Command-Line Tools
 
 Group:          Applications/Internet
@@ -65,6 +65,9 @@ Patch25:        euca2ools-1.3.1-imageattr-ptr.patch
 # https://bugs.launchpad.net/euca2ools/+bug/704658
 # Patch is based on upstream bzr rev 443
 Patch26:        euca2ools-1.3.1-uploadloc.patch
+# Allow boot-from-EBS image registration
+# Patch is based on upstream bzr rev 416
+Patch27:        euca2ools-1.3.1-ebsreg.patch
 
 Requires:       m2crypto
 Requires:       python-boto
@@ -116,6 +119,7 @@ Eucalyptus.  These tools are also compatible with Amazon AWS.
 %patch24 -p1
 %patch25 -p1
 %patch26 -p1
+%patch27 -p1
 
 
 %build
@@ -151,6 +155,9 @@ rm -rf %{buildroot}
 %doc README
 
 %changelog
+* Fri Jul 22 2011 Garrett Holmstrom <gholms at fedoraprojecto.rg> - 1.3.1-12
+- Fixed registration of EBS-backed images
+
 * Fri Jul  1 2011 Garrett Holmstrom <gholms at fedoraproject.org> - 1.3.1-11
 - Backported support for bundle upload location constraints [LP:704658]
 


More information about the scm-commits mailing list