summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2011-11-22 20:52:00 +0000
committerGerrit Code Review <review@openstack.org>2011-11-22 20:52:00 +0000
commita35c17e8338d4cab4fc1fd1f2db38a4b05c9ebc5 (patch)
tree63ac20752a207a9f685514c313396ba09bb39cde /nova/api
parentbb622e6d7c921894fd0e7697a0003630989d4f35 (diff)
parentf2777f1670c3e549171bceac08b0a81d5776e739 (diff)
downloadnova-a35c17e8338d4cab4fc1fd1f2db38a4b05c9ebc5.tar.gz
nova-a35c17e8338d4cab4fc1fd1f2db38a4b05c9ebc5.tar.xz
nova-a35c17e8338d4cab4fc1fd1f2db38a4b05c9ebc5.zip
Merge "Change compute API.update() to take object+params"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/cloud.py4
-rw-r--r--nova/api/openstack/v2/servers.py7
2 files changed, 7 insertions, 4 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 4019d0089..eb4945412 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -1354,8 +1354,8 @@ class CloudController(object):
changes[field] = kwargs[field]
if changes:
instance_id = ec2utils.ec2_id_to_id(instance_id)
- self.compute_api.update(context, instance_id=instance_id,
- **changes)
+ instance = self.compute_api.get(context, instance_id)
+ self.compute_api.update(context, instance, **changes)
return True
def _get_image(self, context, ec2_id):
diff --git a/nova/api/openstack/v2/servers.py b/nova/api/openstack/v2/servers.py
index 1ae7f80bf..144566d33 100644
--- a/nova/api/openstack/v2/servers.py
+++ b/nova/api/openstack/v2/servers.py
@@ -491,12 +491,15 @@ class Controller(wsgi.Controller):
body['server']['auto_disk_config'])
update_dict['auto_disk_config'] = auto_disk_config
+ instance = self.compute_api.routing_get(ctxt, id)
+
try:
- self.compute_api.update(ctxt, id, **update_dict)
+ self.compute_api.update(ctxt, instance, **update_dict)
except exception.NotFound:
raise exc.HTTPNotFound()
- instance = self.compute_api.routing_get(ctxt, id)
+ instance.update(update_dict)
+
return self._view_builder.show(req, instance)
@exception.novaclient_converter