summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-05-24 05:29:24 +0000
committerGerrit Code Review <review@openstack.org>2013-05-24 05:29:24 +0000
commite7bcf0d5ec52fc9aeb932a62121d5a8462f74253 (patch)
tree85de224f3ff666531f739d892dbaf5def42ae7c1 /nova/api
parent738a395eba63b51456ce6fa5b959bb9bf032b3d4 (diff)
parent65a6264c236a779712694d2379cfe4f9e46e2732 (diff)
downloadnova-e7bcf0d5ec52fc9aeb932a62121d5a8462f74253.tar.gz
nova-e7bcf0d5ec52fc9aeb932a62121d5a8462f74253.tar.xz
nova-e7bcf0d5ec52fc9aeb932a62121d5a8462f74253.zip
Merge "Disallow resize if image not available"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/servers.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py
index cec7cbd60..41c3b92a5 100644
--- a/nova/api/openstack/compute/servers.py
+++ b/nova/api/openstack/compute/servers.py
@@ -1094,6 +1094,17 @@ class Controller(wsgi.Controller):
except exception.InstanceInvalidState as state_error:
common.raise_http_conflict_for_instance_invalid_state(state_error,
'resize')
+ except exception.ImageNotAuthorized as image_error:
+ msg = _("You are not authorized to access the image "
+ "the instance was started with.")
+ raise exc.HTTPUnauthorized(explanation=msg)
+ except exception.ImageNotFound as image_error:
+ msg = _("Image that the instance was started "
+ "with could not be found.")
+ raise exc.HTTPBadRequest(explanation=msg)
+ except exception.Invalid:
+ msg = _("Invalid instance image.")
+ raise exc.HTTPBadRequest(explanation=msg)
return webob.Response(status_int=202)