summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-01-05 17:03:22 +0000
committerGerrit Code Review <review@openstack.org>2012-01-05 17:03:22 +0000
commitd41ea536ba55e8285e2db88415f09c80a799acfa (patch)
treeb78093b442827ebd0db3f61cc94323af8bf05e5c /nova/api
parentd7887419f4e28cd948e3bdd8644f5e329a81695c (diff)
parent18f72f29a92733e56d8641e48b2099df1b8b30f4 (diff)
Merge "Return 409s instead of 500s when deleting certain instances."
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/v2/servers.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/nova/api/openstack/v2/servers.py b/nova/api/openstack/v2/servers.py
index d98d532dc..bab2976f9 100644
--- a/nova/api/openstack/v2/servers.py
+++ b/nova/api/openstack/v2/servers.py
@@ -575,6 +575,10 @@ class Controller(wsgi.Controller):
self._delete(req.environ['nova.context'], id)
except exception.NotFound:
raise exc.HTTPNotFound()
+ except exception.InstanceInvalidState as state_error:
+ state = state_error.kwargs.get("state")
+ msg = _("Unable to delete instance when %s") % state
+ raise exc.HTTPConflict(explanation=msg)
def _get_key_name(self, req, body):
if 'server' in body: