diff options
| author | Jenkins <jenkins@review.openstack.org> | 2011-11-22 20:52:00 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2011-11-22 20:52:00 +0000 |
| commit | a35c17e8338d4cab4fc1fd1f2db38a4b05c9ebc5 (patch) | |
| tree | 63ac20752a207a9f685514c313396ba09bb39cde /nova/api | |
| parent | bb622e6d7c921894fd0e7697a0003630989d4f35 (diff) | |
| parent | f2777f1670c3e549171bceac08b0a81d5776e739 (diff) | |
| download | nova-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.py | 4 | ||||
| -rw-r--r-- | nova/api/openstack/v2/servers.py | 7 |
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 |
