summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-21 12:46:11 +0000
committerGerrit Code Review <review@openstack.org>2013-06-21 12:46:11 +0000
commitd8c9864d95bec6d2babb2cb5a2aeeb284fca4834 (patch)
tree89d468e4e38a27277da498f3f0593118f8576ec5 /nova/api
parent253e0aab8f774db5f62cf1809a73d51c708aa927 (diff)
parent99c51e34230394cadf0b82e364ea10c38e193979 (diff)
downloadnova-d8c9864d95bec6d2babb2cb5a2aeeb284fca4834.tar.gz
nova-d8c9864d95bec6d2babb2cb5a2aeeb284fca4834.tar.xz
nova-d8c9864d95bec6d2babb2cb5a2aeeb284fca4834.zip
Merge "Allow reboot or rebuild from vm_state=Error"
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/common.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/api/openstack/common.py b/nova/api/openstack/common.py
index bec919f4b..dd746e23d 100644
--- a/nova/api/openstack/common.py
+++ b/nova/api/openstack/common.py
@@ -358,9 +358,12 @@ def raise_http_conflict_for_instance_invalid_state(exc, action):
"""
attr = exc.kwargs.get('attr')
state = exc.kwargs.get('state')
+ not_launched = exc.kwargs.get('not_launched')
if attr and state:
msg = _("Cannot '%(action)s' while instance is in %(attr)s "
"%(state)s") % {'action': action, 'attr': attr, 'state': state}
+ elif not_launched:
+ msg = _("Cannot '%s' an instance which has never been active") % action
else:
# At least give some meaningful message
msg = _("Instance is in an invalid state for '%s'") % action