summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorBrian Waldon <brian.waldon@rackspace.com>2011-11-09 12:24:00 -0500
committerBrian Waldon <brian.waldon@rackspace.com>2011-11-09 12:25:10 -0500
commit29398355ede0d8fb08c58bbf2adf0441b48c6855 (patch)
treedbc7543ec1d98093755e562d4120001f0d0f9ad2 /nova/api
parent00861098508fc675ba2d90a5c34fec152ddf5c3d (diff)
downloadnova-29398355ede0d8fb08c58bbf2adf0441b48c6855.tar.gz
nova-29398355ede0d8fb08c58bbf2adf0441b48c6855.tar.xz
nova-29398355ede0d8fb08c58bbf2adf0441b48c6855.zip
Converting resize to use instance objects
Related to blueprint internal-uuids Change-Id: I94b4383b55ac72bccae1dd375d82f5e7c3f8cebf
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 2a1424e46..44f943711 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -583,8 +583,10 @@ class Controller(object):
return resp
def _action_confirm_resize(self, input_dict, req, id):
+ context = req.environ['nova.context']
+ instance = self._get_server(context, id)
try:
- self.compute_api.confirm_resize(req.environ['nova.context'], id)
+ self.compute_api.confirm_resize(context, instance)
except exception.MigrationNotFound:
msg = _("Instance has not been resized.")
raise exc.HTTPBadRequest(explanation=msg)
@@ -594,8 +596,10 @@ class Controller(object):
return exc.HTTPNoContent()
def _action_revert_resize(self, input_dict, req, id):
+ context = req.environ['nova.context']
+ instance = self._get_server(context, id)
try:
- self.compute_api.revert_resize(req.environ['nova.context'], id)
+ self.compute_api.revert_resize(context, instance)
except exception.MigrationNotFound:
msg = _("Instance has not been resized.")
raise exc.HTTPBadRequest(explanation=msg)
@@ -651,9 +655,10 @@ class Controller(object):
def _resize(self, req, instance_id, flavor_id):
"""Begin the resize process with given instance/flavor."""
context = req.environ["nova.context"]
+ instance = self._get_server(context, instance_id)
try:
- self.compute_api.resize(context, instance_id, flavor_id)
+ self.compute_api.resize(context, instance, flavor_id)
except exception.FlavorNotFound:
msg = _("Unable to locate requested flavor.")
raise exc.HTTPBadRequest(explanation=msg)