Skip to content

Commit

Permalink
Display owner in ec2 describe images
Browse files Browse the repository at this point in the history
 * use owner field from glance
 * remove unneccessary project_id field in s3 registration
 * fixes bug 798998

Change-Id: I8d88ff258b914899212d63a7d31d83722d0cb559
  • Loading branch information
vishvananda committed Mar 10, 2012
1 parent 6f67c9d commit a6ac8af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nova/api/ec2/cloud.py
Expand Up @@ -1392,7 +1392,7 @@ def _format_image(self, image):
ramdisk_id = image['properties'].get('ramdisk_id')
if ramdisk_id:
i['ramdiskId'] = ec2utils.image_ec2_id(ramdisk_id, 'ari')
i['imageOwnerId'] = image['properties'].get('owner_id')
i['imageOwnerId'] = image.get('owner')

img_loc = image['properties'].get('image_location')
if img_loc:
Expand Down
1 change: 0 additions & 1 deletion nova/image/s3.py
Expand Up @@ -238,7 +238,6 @@ def _s3_parse_manifest(self, context, metadata, manifest):
mappings = []

properties = metadata['properties']
properties['project_id'] = context.project_id
properties['architecture'] = arch

def _translate_dependent_image_id(image_key, image_id):
Expand Down
3 changes: 2 additions & 1 deletion nova/tests/api/ec2/test_cloud.py
Expand Up @@ -1236,14 +1236,15 @@ def test_format_image(self):
'id': 1,
'container_format': 'ami',
'name': 'name',
'owner': 'someone',
'properties': {
'image_location': 'location',
'kernel_id': 1,
'ramdisk_id': 1,
'type': 'machine'},
'is_public': False}
expected = {'name': 'name',
'imageOwnerId': None,
'imageOwnerId': 'someone',
'isPublic': False,
'imageId': 'ami-00000001',
'imageState': None,
Expand Down

0 comments on commit a6ac8af

Please sign in to comment.