From 48c275da1271f47b43e1270a3bdd99c7e20dd122 Mon Sep 17 00:00:00 2001 From: Alex Meade Date: Mon, 23 Jan 2012 21:30:20 +0000 Subject: Instances to be created with a bookmark link Fixes bug 913545 Change-Id: I6401a631211d76a8942d3435fb7dd463630cac7a --- nova/api/openstack/compute/servers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'nova/api') 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') -- cgit