summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2011-10-17 17:36:31 +0000
committerGerrit Code Review <review@openstack.org>2011-10-17 17:36:31 +0000
commitddb49f7929bf29d2003ffdd3a14831d36d2f9d07 (patch)
tree23122ad9db5f27407fa8ffe4fa2240d3f6cfac1d /nova/api
parent1ebd98e3d20a35fc543800677cfe5e006a2f8cab (diff)
parent261b4111d481562760321bfc83d64ba35e981b5b (diff)
downloadnova-ddb49f7929bf29d2003ffdd3a14831d36d2f9d07.tar.gz
nova-ddb49f7929bf29d2003ffdd3a14831d36d2f9d07.tar.xz
nova-ddb49f7929bf29d2003ffdd3a14831d36d2f9d07.zip
Merge "Explicit errors on confirm/revertResize failures"
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 61cda6782..9cc0872c6 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()