summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorBrian Waldon <brian.waldon@rackspace.com>2011-09-26 13:57:34 -0400
committerBrian Waldon <brian.waldon@rackspace.com>2011-10-10 12:00:47 -0400
commit261b4111d481562760321bfc83d64ba35e981b5b (patch)
treed6de159da4298db1fd801a9129b1930ff34ab8ab /nova/api
parent33e58925c75b66c6800d3ba6068ee1e4f0db6617 (diff)
downloadnova-261b4111d481562760321bfc83d64ba35e981b5b.tar.gz
nova-261b4111d481562760321bfc83d64ba35e981b5b.tar.xz
nova-261b4111d481562760321bfc83d64ba35e981b5b.zip
Explicit errors on confirm/revertResize failures
Fixing bug 856527 Change-Id: Ib9be618596ade2e9a899ecdc10ec9f61bf06958a
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/servers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nova/api/openstack/servers.py b/nova/api/openstack/servers.py
index 18eef2464..c45e7510c 100644
--- a/nova/api/openstack/servers.py
+++ b/nova/api/openstack/servers.py
@@ -664,6 +664,9 @@ class Controller(object):
def _action_confirm_resize(self, input_dict, req, id):
try:
self.compute_api.confirm_resize(req.environ['nova.context'], id)
+ except exception.MigrationNotFound:
+ msg = _("Instance has not been resized.")
+ raise exc.HTTPBadRequest(explanation=msg)
except Exception, e:
LOG.exception(_("Error in confirm-resize %s"), e)
raise exc.HTTPBadRequest()
@@ -672,6 +675,9 @@ class Controller(object):
def _action_revert_resize(self, input_dict, req, id):
try:
self.compute_api.revert_resize(req.environ['nova.context'], id)
+ except exception.MigrationNotFound:
+ msg = _("Instance has not been resized.")
+ raise exc.HTTPBadRequest(explanation=msg)
except Exception, e:
LOG.exception(_("Error in revert-resize %s"), e)
raise exc.HTTPBadRequest()