Skip to content

Commit

Permalink
Fixing image create in S3ImageService
Browse files Browse the repository at this point in the history
Fixes bug 890486

Change-Id: I80b7fc1952acf8d6bc0eaa4fc5fffe8d097a043c
  • Loading branch information
Brian Waldon committed Nov 15, 2011
1 parent 4201b01 commit 81c8c3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 7 additions & 6 deletions nova/image/s3.py
Expand Up @@ -211,15 +211,16 @@ def _s3_parse_manifest(self, context, metadata, manifest):
properties['project_id'] = context.project_id
properties['architecture'] = arch

def _translate_dependent_image_id(image_key, image_id):
image_id = ec2utils.ec2_id_to_id(image_id)
image_uuid = self.get_image_uuid(context, image_id)
properties['image_id'] = image_uuid

if kernel_id:
kernel_id = ec2_utils.ec2_id_to_id(kernel_id)
kernel_uuid = self._get_image_uuid(context, kernel_id)
properties['kernel_id'] = kernel_uuid
_translate_dependent_image_id('kernel_id', kernel_id)

if ramdisk_id:
ramdisk_id = ec2utils.ec2_id_to_id(ramdisk_id)
ramdisk_uuid = self._get_image_uuid(context, ramdisk_id)
properties['ramdisk_id'] = ramdisk_uuid
_translate_dependent_image_id('ramdisk_id', ramdisk_id)

if mappings:
properties['mappings'] = mappings
Expand Down
2 changes: 2 additions & 0 deletions nova/tests/image/test_s3.py
Expand Up @@ -50,6 +50,8 @@
<device>sda3</device>
</mapping>
</block_device_mapping>
<kernel_id>aki-00000001</kernel_id>
<ramdisk_id>ari-00000001</ramdisk_id>
</machine_configuration>
</manifest>
"""
Expand Down

0 comments on commit 81c8c3a

Please sign in to comment.