summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorKevin L. Mitchell <kevin.mitchell@rackspace.com>2011-08-25 21:56:45 +0000
committerKevin L. Mitchell <kevin.mitchell@rackspace.com>2011-08-25 21:56:45 +0000
commit2cf0b67e08e1608bd717ffadd41d5029db2b4a3a (patch)
treea7c0e4f75391220ce906c20a72ece22e96b31b94 /nova/api
parent847d6aecb64d7abece4d4f426f26a9561ffb1e51 (diff)
downloadnova-2cf0b67e08e1608bd717ffadd41d5029db2b4a3a.tar.gz
nova-2cf0b67e08e1608bd717ffadd41d5029db2b4a3a.tar.xz
nova-2cf0b67e08e1608bd717ffadd41d5029db2b4a3a.zip
Fix glance image authorization check now that glance can do authorization checks on its own; use correct image service when looking for ramdisk, etc.; fix a couple of PEP8 errors
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/create_instance_helper.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py
index 483ff4985..c428a8209 100644
--- a/nova/api/openstack/create_instance_helper.py
+++ b/nova/api/openstack/create_instance_helper.py
@@ -98,7 +98,7 @@ class CreateInstanceHelper(object):
try:
image_service, image_id = nova.image.get_image_service(image_href)
kernel_id, ramdisk_id = self._get_kernel_ramdisk_from_image(
- req, image_id)
+ req, image_service, image_id)
images = set([str(x['id']) for x in image_service.index(context)])
assert str(image_id) in images
except Exception, e:
@@ -248,12 +248,12 @@ class CreateInstanceHelper(object):
msg = _("Server name is an empty string")
raise exc.HTTPBadRequest(explanation=msg)
- def _get_kernel_ramdisk_from_image(self, req, image_id):
+ def _get_kernel_ramdisk_from_image(self, req, image_service, image_id):
"""Fetch an image from the ImageService, then if present, return the
associated kernel and ramdisk image IDs.
"""
context = req.environ['nova.context']
- image_meta = self._image_service.show(context, image_id)
+ image_meta = image_service.show(context, image_id)
# NOTE(sirp): extracted to a separate method to aid unit-testing, the
# new method doesn't need a request obj or an ImageService stub
kernel_id, ramdisk_id = self._do_get_kernel_ramdisk_from_image(