summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJanis Gengeris <janis.gengeris@gmail.com>2013-01-01 17:14:18 +0200
committerJanis Gengeris <janis.gengeris@gmail.com>2013-01-01 17:14:18 +0200
commit86008a67aade0d8830bf353395729fa55e54b8d8 (patch)
tree0470125a3a3f7073853e7a2f457c6cd5468960ad /nova/api
parentb8b8f2032483e5f3d6c09b7b6fddd07301805230 (diff)
downloadnova-86008a67aade0d8830bf353395729fa55e54b8d8.tar.gz
nova-86008a67aade0d8830bf353395729fa55e54b8d8.tar.xz
nova-86008a67aade0d8830bf353395729fa55e54b8d8.zip
Raise BadRequest when updating 'personality'
Updating booted server instance through server PUT API call with 'personality' property set is not returning 'Bad Request', although the property is not allowed to be updated once the instance is booted. This fixes the described problem. Fixes bug #1032546 Change-Id: Ia086f5ea5176640a9916a3ba42c79d4d5944ce76
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/servers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index a62740681..b0531d0e4 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -981,6 +981,10 @@ class Controller(wsgi.Controller):
msg = _("HostId cannot be updated.")
raise exc.HTTPBadRequest(explanation=msg)
+ if 'personality' in body['server']:
+ msg = _("Personality cannot be updated.")
+ raise exc.HTTPBadRequest(explanation=msg)
+
try:
instance = self.compute_api.get(ctxt, id)
req.cache_db_instance(instance)