summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Young <sleepsonthefloor@gmail.com>2011-07-26 16:20:31 -0700
committerAnthony Young <sleepsonthefloor@gmail.com>2011-07-26 16:20:31 -0700
commitc95ee1625a6a88afdb77d305077d1ee7eeaae854 (patch)
tree995b6fa6488b8537a7e9966f25abda3ff86586a9
parent4a52d4984e9349115f37d34e47e4d1141a8cf6fc (diff)
fix for lp816713: In instance creation, when nova-api is passed imageRefs generated by itself, strip the url down to an id so that default glance connection params are used
-rw-r--r--nova/api/openstack/create_instance_helper.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py
index f8317565e..0e6c0a87c 100644
--- a/nova/api/openstack/create_instance_helper.py
+++ b/nova/api/openstack/create_instance_helper.py
@@ -87,6 +87,10 @@ class CreateInstanceHelper(object):
key_data = key_pair['public_key']
image_href = self.controller._image_ref_from_req_data(body)
+ # If the image href was generated by nova api, strip image_href
+ # down to an id and use the default glance connection params
+ if image_href.startswith(req.application_url):
+ image_href = image_href.split('/').pop()
try:
image_service, image_id = nova.image.get_image_service(image_href)
kernel_id, ramdisk_id = self._get_kernel_ramdisk_from_image(