summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-08-21 02:33:34 +0000
committerGerrit Code Review <review@openstack.org>2012-08-21 02:33:34 +0000
commit0272c063bbc32f1ff39f2baa8ae3f0764723ef73 (patch)
treeb60c5aae26321138c75bbf7ba05e71974b400bee /nova/api
parent8d633f251f624bb109315573fc149bd7e4781d94 (diff)
parent1a605cccb1fe29ae6554ad5afa3110abef11d9c2 (diff)
downloadnova-0272c063bbc32f1ff39f2baa8ae3f0764723ef73.tar.gz
nova-0272c063bbc32f1ff39f2baa8ae3f0764723ef73.tar.xz
nova-0272c063bbc32f1ff39f2baa8ae3f0764723ef73.zip
Merge "Return HTTP 422 on bad server update PUT request."
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/disk_config.py3
-rw-r--r--nova/api/openstack/compute/servers.py3
2 files changed, 5 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/contrib/disk_config.py b/nova/api/openstack/compute/contrib/disk_config.py
index 293be7415..903f930fc 100644
--- a/nova/api/openstack/compute/contrib/disk_config.py
+++ b/nova/api/openstack/compute/contrib/disk_config.py
@@ -148,7 +148,8 @@ class ServerDiskConfigController(wsgi.Controller):
def update(self, req, id, body):
context = req.environ['nova.context']
if authorize(context):
- self._set_disk_config(body['server'])
+ if 'server' in body:
+ self._set_disk_config(body['server'])
resp_obj = (yield)
self._show(req, resp_obj)
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index a7baf62d7..104f6ab99 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -813,6 +813,9 @@ class Controller(wsgi.Controller):
if not body:
raise exc.HTTPUnprocessableEntity()
+ if not 'server' in body:
+ raise exc.HTTPUnprocessableEntity()
+
ctxt = req.environ['nova.context']
update_dict = {}