summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvaddi-kiran <vaddi_kiran@persistent.co.in>2012-04-09 06:38:54 -0400
committervaddi kiran <vaddi_kiran@persistent.co.in>2012-04-26 05:56:57 -0400
commit6a4c092cb8d9bd2f99a29392bc3b5e566f858b52 (patch)
tree5a44cbc531491e33c9a07179249c28db7f98522d
parentcaa1b282c701d5e9b9e02ffdb07d432d9b35ed13 (diff)
Make updating hostId raises BadRequest.
fixes bug 944028 Change-Id: I563f51dd7afea1d0a9c7391c9e641e7c8c493216
-rw-r--r--Authors1
-rw-r--r--nova/api/openstack/compute/servers.py4
2 files changed, 5 insertions, 0 deletions
diff --git a/Authors b/Authors
index 3a451dd2f..a75a39a20 100644
--- a/Authors
+++ b/Authors
@@ -196,6 +196,7 @@ Vasiliy Shlykov <vash@vasiliyshlykov.org>
Vishvananda Ishaya <vishvananda@gmail.com>
Vivek Y S <vivek.ys@gmail.com>
Vladimir Popovski <vladimir@zadarastorage.com>
+Vaddi kiran <vaddi_kiran@persistent.co.in>
William Henry <whenry@redhat.com>
William Kelly <william.kelly@rackspace.com>
William Wolf <throughnothing@gmail.com>
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index ef7e29ac0..6390e8b34 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -800,6 +800,10 @@ class Controller(wsgi.Controller):
body['server']['auto_disk_config'])
update_dict['auto_disk_config'] = auto_disk_config
+ if 'hostId' in body['server']:
+ msg = _("HostId cannot be updated.")
+ raise exc.HTTPBadRequest(explanation=msg)
+
try:
instance = self.compute_api.get(ctxt, id)
self.compute_api.update(ctxt, instance, **update_dict)