DescribeImages response prevents listing images correctly for ElastixFox/tAWS

Bug #750482 reported by Masanori Itoh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Masanori Itoh

Bug Description

Hi,

I'm working on nova using ElasticFox (1.7 build 000116 (EC2 API 2010-06-15)
and tAWS (0.5.0), and I noticed that current DescribeImages response contains
incompatibility which prevents ElasticFox and tAWS from displaying the result correctly.

There are two issues.

Currently, _format_image called from describe_images() in nova/api/ec2/cloud.py:

1) Appends 'name' property to <imageId> tag for images converted by
   'nova-manage image convert'. (I.e., if 'name' exists)
   ElasticFox and tAWS cannot handle this additional string and fail to display image listing.
   I know that it's useful showing the original names, and so I suggest appending it
   to <imageLocation> tag instead of <imageId> if 'name' exists.

2) Uses <type> instead of <imageType>. This is not compliant to EC2 API spec.

The patch below fixes the above two issues, and here are results
of euca-describe-images before/after applying it.

What do you think about?

=== modified file 'nova/api/ec2/cloud.py'
--- nova/api/ec2/cloud.py 2011-04-01 16:44:12 +0000
+++ nova/api/ec2/cloud.py 2011-04-04 16:37:20 +0000
@@ -886,10 +886,7 @@
         image_type = image['properties'].get('type')
         ec2_id = self._image_ec2_id(image.get('id'), image_type)
         name = image.get('name')
- if name:
- i['imageId'] = "%s (%s)" % (ec2_id, name)
- else:
- i['imageId'] = ec2_id
+ i['imageId'] = ec2_id
         kernel_id = image['properties'].get('kernel_id')
         if kernel_id:
             i['kernelId'] = self._image_ec2_id(kernel_id, 'kernel')
@@ -897,11 +894,15 @@
         if ramdisk_id:
             i['ramdiskId'] = self._image_ec2_id(ramdisk_id, 'ramdisk')
         i['imageOwnerId'] = image['properties'].get('owner_id')
- i['imageLocation'] = image['properties'].get('image_location')
+ if name:
+ i['imageLocation'] = "%s (%s)" % (image['properties'].
+ get('image_location'), name)
+ else:
+ i['imageLocation'] = image['properties'].get('image_location')
         i['imageState'] = image['properties'].get('image_state')
- i['displayName'] = image.get('name')
+ i['displayName'] = name
         i['description'] = image.get('description')
- i['type'] = image_type
+ i['imageType'] = image_type
         i['isPublic'] = str(image['properties'].get('is_public', '')) == 'True'
         i['architecture'] = image['properties'].get('architecture')
         return i

BEFORE
|root@shayol:/home/itoumsn# euca-describe-images
|IMAGE ari-26b4ed32 (ari-tty) nova/tty-ramdisk admin available public x86_64 ramdisk
|IMAGE aki-303b6dd9 (aki-tty) nova/tty-kernel admin available public x86_64 kernel
|IMAGE ami-250c5dc3 (ami-tty) demo/tty admin available public x86_64 machine aki-303b6dd9 ari-26b4ed32

AFTER
|root@shayol:/home/itoumsn# euca-describe-images
|IMAGE ari-26b4ed32 nova/tty-ramdisk (ari-tty) admin available public x86_64 ramdisk
|IMAGE aki-303b6dd9 nova/tty-kernel (aki-tty) admin available public x86_64 kernel
|IMAGE ami-250c5dc3 demo/tty (ami-tty) admin available public x86_64 machine aki-303b6dd9 ari-26b4ed32

Related branches

Revision history for this message
Masanori Itoh (itohm) wrote :

Hi,

I rebased lp:~itoumsn/nova/lp750482 to trunk rev 941, and I assigned this bug to me.
If it's confirmed, I will post a merge request.

Thanks,
-Masanori

Changed in nova:
assignee: nobody → Masanori Itoh (itoumsn)
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
status: Confirmed → In Progress
Masanori Itoh (itohm)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.