Code review comment for lp://qastaging/~justin-fathomdb/nova/ec2-api-with-glance

Revision history for this message
justinsb (justin-fathomdb) wrote :

I don't see how this would have been fixed:
http://bazaar.launchpad.net/~hudson-openstack/nova/trunk/view/head:/nova/api/ec2/cloud.py

def _format_image(self, image):
        """Convert from format defined by BaseImageService to S3 format."""
        i = {}
        image_type = image['properties'].get('type')
        ec2_id = self._image_ec2_id(image.get('id'), image_type)

...

 _type_prefix_map = {'machine': 'ami',
                        'kernel': 'aki',
                        'ramdisk': 'ari'}

def _image_ec2_id(self, image_id, image_type='machine'):
        prefix = self._type_prefix_map[image_type]

---

No images['properties']['type'] => KAPOW!

« Back to merge proposal