diff options
| author | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2012-03-26 20:43:43 +0000 |
|---|---|---|
| committer | Johannes Erdfelt <johannes.erdfelt@rackspace.com> | 2012-03-26 20:46:15 +0000 |
| commit | 575ad8f77dc7095c8a0ba9dd8deb41bf2fddae1f (patch) | |
| tree | fae498a183c224e99e93aca00299b4449321c23c /nova/api | |
| parent | 3433fd65d5f70d83ffa4db013f96c55970ea293e (diff) | |
| download | nova-575ad8f77dc7095c8a0ba9dd8deb41bf2fddae1f.tar.gz nova-575ad8f77dc7095c8a0ba9dd8deb41bf2fddae1f.tar.xz nova-575ad8f77dc7095c8a0ba9dd8deb41bf2fddae1f.zip | |
Fix unrescue in invalid state
Fixes bug 965667
Unrescue did not check for InstanceInvalidState exception and return the
appropriate error.
Change-Id: I3ca2c1dae09bd149086bfe67e2233c8359d5c8f8
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/rescue.py | 6 |
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) |
