~ubuntu-branches/ubuntu/natty/euca2ools/natty-201106142030

« back to all changes in this revision

Viewing changes to debian/patches/describe-image-attribute-empty-kernel-ramdisk.patch

  • Committer: Scott Moser
  • Date: 2010-11-17 21:23:16 UTC
  • Revision ID: smoser@ubuntu.com-20101117212316-is94e55u3jv46y9l
move to quilt 3.0 source format, re-apply all relevant delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: euca-describe-image-attribute: fix --kernel/--ramdisk if empty
 
2
 If an image does not have a ramdisk or kernel associated with it
 
3
 (such as 10.04 or 11.04 images), then running:
 
4
   euca-describe-image-attribute --kernel ami-abcdefg
 
5
 will show a stack trace
 
6
 .
 
7
 Originally from 1.2-0ubuntu8 package version
 
8
Author: Scott Moser <scott.moser@canonical.com>
 
9
Last-Update: 2010-11-17
 
10
Bug: https://launchpad.net/bugs/546551
 
11
Forwarded: no
 
12
--- a/bin/euca-describe-image-attribute
 
13
+++ b/bin/euca-describe-image-attribute
 
14
@@ -88,10 +88,10 @@
 
15
                 % (image_attribute.image_id, product_code)
 
16
     if image_attribute.kernel is not None:
 
17
         print 'kernel\t%s\t\t%s' % (image_attribute.image_id,
 
18
-                                    image_attribute.value)
 
19
+                                    getattr(image_attribute, 'value', ""))
 
20
     if image_attribute.ramdisk is not None:
 
21
         print 'ramdisk\t%s\t\t%s' % (image_attribute.image_id,
 
22
-                image_attribute.value)
 
23
+                                     getattr(image_attribute, 'value', ""))
 
24
     if image_attribute.attrs.has_key('block_device_mapping'):
 
25
         block_device_mapping = \
 
26
             image_attribute.attrs['block_device_mapping']