summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/compute/contrib/rescue.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/nova/api/openstack/compute/contrib/rescue.py b/nova/api/openstack/compute/contrib/rescue.py
index b46b12a18..7bf815a37 100644
--- a/nova/api/openstack/compute/contrib/rescue.py
+++ b/nova/api/openstack/compute/contrib/rescue.py
@@ -72,7 +72,11 @@ class RescueController(wsgi.Controller):
context = req.environ["nova.context"]
authorize(context)
instance = self._get_instance(context, id)
- self.compute_api.unrescue(context, instance)
+ try:
+ self.compute_api.unrescue(context, instance)
+ except exception.InstanceInvalidState as state_error:
+ common.raise_http_conflict_for_instance_invalid_state(state_error,
+ 'unrescue')
return webob.Response(status_int=202)