diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-01-18 04:57:51 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-01-18 04:57:51 +0000 |
| commit | ad8843740154ebfa1e1be90413b9c5e973af9849 (patch) | |
| tree | 05a8b492d7f75a28ae310275b91b0f54a553019a /nova/api | |
| parent | 7bb9f3413a2bc6ef56ab3c384d0624f193e58e34 (diff) | |
| parent | ae808ad735c39c0bff3e051dbd37ea2a60072649 (diff) | |
Merge "Stop allowing blank image names on snapshot/backup"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/servers.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index 0648a43ba..0d8165784 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -1105,17 +1105,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) |
