summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorAnthony Young <sleepsonthefloor@gmail.com>2011-08-02 22:57:24 +0000
committerTarmac <>2011-08-02 22:57:24 +0000
commit84b7fb7e27904deafba8bff2fd9179013ec30e30 (patch)
treeb6f6d09ef23e30c07740c622c13a9614d9c187c9 /nova/api
parent3821904c962ac0826d42660898b20b8413c727f2 (diff)
parent0e5b2b0bfb7f6b0af7f2c962a963830a8691410e (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
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/create_instance_helper.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/nova/api/openstack/create_instance_helper.py b/nova/api/openstack/create_instance_helper.py
index 53e814cd5..a2d18d37e 100644
--- a/nova/api/openstack/create_instance_helper.py
+++ b/nova/api/openstack/create_instance_helper.py
@@ -90,6 +90,11 @@ 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 str(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(