From 84a83c67d81f41c00ca9259ebebec97e6e7788bb Mon Sep 17 00:00:00 2001 From: Zhou ShaoYu Date: Tue, 29 Jan 2013 15:33:46 +0800 Subject: 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 --- nova/api/openstack/compute/servers.py | 2 ++ 1 file changed, 2 insertions(+) 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) -- cgit