summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorRick Harris <rick.harris@rackspace.com>2011-02-15 21:54:42 +0000
committerRick Harris <rick.harris@rackspace.com>2011-02-15 21:54:42 +0000
commitc33378fbbe0fd76e807530522715ba4175af18d8 (patch)
treef0089afc7ece9d739ba6797018ea1f1ffeaefb2a /nova/api
parent1d72b9d3ddc835d788ba1fec1a937c2788e94b38 (diff)
Fixing typo
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index cd0cea235..c15e499a0 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -129,8 +129,12 @@ class Controller(wsgi.Controller):
Machine images are associated with Kernels and Ramdisk images via
metadata stored in Glance as 'image_properties'
"""
- def lookup(param):
- _image_id = image_id
+ # FIXME(sirp): Currently Nova requires us to specify the `null_kernel`
+ # identifier ('nokernel') to indicate a RAW (or VHD) image. It would
+ # be better if we could omit the kernel_id and ramdisk_id properties
+ # on the image
+ def lookup(image, param):
+ _image_id = image.id
try:
return image['properties'][param]
except KeyError:
@@ -138,7 +142,8 @@ class Controller(wsgi.Controller):
_("%(param)s property not found for image %(_image_id)s") %
locals())
- return lookup('kernel_id'), lookup('ramdisk_id')
+ image = self._image_service.show(req.environ['nova.context'], image_id)
+ return lookup(image, 'kernel_id'), lookup(image, 'ramdisk_id')
def create(self, req):
""" Creates a new server for a given user """