diff options
| author | Justin Santa Barbara <justin@fathomdb.com> | 2011-02-22 18:41:41 -0800 |
|---|---|---|
| committer | Justin Santa Barbara <justin@fathomdb.com> | 2011-02-22 18:41:41 -0800 |
| commit | 9f169fdef93898097e33b5e1c0318f543ced672e (patch) | |
| tree | c91ae16efe04ff2d02e2db798e7445edcf97d500 /nova/api | |
| parent | 8684eb3aa638883ea82bbaf8eb59076f1d7e6a05 (diff) | |
| download | nova-9f169fdef93898097e33b5e1c0318f543ced672e.tar.gz nova-9f169fdef93898097e33b5e1c0318f543ced672e.tar.xz nova-9f169fdef93898097e33b5e1c0318f543ced672e.zip | |
Reverted change to focus on the core bug - kernel_id and ramdisk_id are optional
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/servers.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py index 11a84687d..41b05cbb4 100644 --- a/nova/api/openstack/servers.py +++ b/nova/api/openstack/servers.py @@ -144,11 +144,13 @@ class Controller(wsgi.Controller): metadata stored in Glance as 'image_properties' """ def lookup(param): - properties = image.get('properties') - if properties: - return properties.get(param) - else: - return image.get(param) + _image_id = image_id + try: + return image['properties'][param] + except KeyError: + LOG.debug( + _("%(param)s property not found for image %(_image_id)s") % + locals()) image_id = str(image_id) image = self._image_service.show(req.environ['nova.context'], image_id) |
