summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorAlex Meade <alex.meade@rackspace.com>2012-01-17 20:28:13 +0000
committerAlex Meade <alex.meade@rackspace.com>2012-01-17 20:28:13 +0000
commitae808ad735c39c0bff3e051dbd37ea2a60072649 (patch)
tree47149c490010f565c67653a86884c7d952d59ede /nova/api
parent8c1e0022028a454f536ff211aa200cab9b0111aa (diff)
Stop allowing blank image names on snapshot/backup
Fixes bug 917327 Change-Id: I0b77b088c9fe99354bcec3706fbdc05f3c39ae90
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/servers.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index 274589696..560e67fed 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -1089,17 +1089,12 @@ class Controller(wsgi.Controller):
context = req.environ['nova.context']
entity = body.get("createImage", {})
- try:
- image_name = entity["name"]
+ image_name = entity.get("name")
- except KeyError:
+ if not image_name:
msg = _("createImage entity requires name attribute")
raise exc.HTTPBadRequest(explanation=msg)
- except TypeError:
- msg = _("Malformed createImage entity")
- raise exc.HTTPBadRequest(explanation=msg)
-
props = {}
metadata = entity.get('metadata', {})
common.check_img_metadata_quota_limit(context, metadata)