summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-02-01 19:54:19 +0000
committerGerrit Code Review <review@openstack.org>2012-02-01 19:54:19 +0000
commitecbc3322082a0c054a61cb2bcaa5969aa1e3e974 (patch)
tree40e336ca03bfb91038ef669faa48fa62b26e1ec8 /nova/api
parentc6251e8811de82357dee58ffc14c4c1789061876 (diff)
parent48c275da1271f47b43e1270a3bdd99c7e20dd122 (diff)
Merge "Instances to be created with a bookmark link"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/servers.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index d0e771e22..925c6d42c 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -636,8 +636,11 @@ class Controller(wsgi.Controller):
# 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()
+ image_href = image_href.split('/').pop()
+
+ if not utils.is_uuid_like(str(image_href)):
+ msg = _("Invalid imageRef provided.")
+ raise exc.HTTPBadRequest(explanation=msg)
personality = server_dict.get('personality')
config_drive = server_dict.get('config_drive')