From 6a4c092cb8d9bd2f99a29392bc3b5e566f858b52 Mon Sep 17 00:00:00 2001 From: vaddi-kiran Date: Mon, 9 Apr 2012 06:38:54 -0400 Subject: Make updating hostId raises BadRequest. fixes bug 944028 Change-Id: I563f51dd7afea1d0a9c7391c9e641e7c8c493216 --- nova/api/openstack/compute/servers.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'nova/api') 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) -- cgit