diff options
author | Zhou ShaoYu <hzzhoushaoyu@corp.netease.com> | 2013-01-29 15:33:46 +0800 |
---|---|---|
committer | Zhou ShaoYu <hzzhoushaoyu@corp.netease.com> | 2013-01-29 15:53:24 +0800 |
commit | 84a83c67d81f41c00ca9259ebebec97e6e7788bb (patch) | |
tree | 2ed13954203509a2e28fb4198d7995a85b890898 | |
parent | ce09c50c9253131396f713edbf11ca427341be0e (diff) | |
download | nova-84a83c67d81f41c00ca9259ebebec97e6e7788bb.tar.gz nova-84a83c67d81f41c00ca9259ebebec97e6e7788bb.tar.xz nova-84a83c67d81f41c00ca9259ebebec97e6e7788bb.zip |
Fix boot with image not active
When boot with image which is not active, nova API response
with http status code 500. We should catch the exception and
raise HTTPBadRequest with more precise information.
Fix LP# 1108645
Change-Id: Ibd78f4b96bfdb925b03d7809d4e28afcc7e1ddcf
-rw-r--r-- | nova/api/openstack/compute/servers.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index 93a07ec3f..90d4c37b3 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -911,6 +911,8 @@ class Controller(wsgi.Controller): except exception.ImageNotFound as error: msg = _("Can not find requested image") raise exc.HTTPBadRequest(explanation=msg) + except exception.ImageNotActive as error: + raise exc.HTTPBadRequest(explanation=unicode(error)) except exception.FlavorNotFound as error: msg = _("Invalid flavorRef provided.") raise exc.HTTPBadRequest(explanation=msg) |