From 942f0404a3d7052830cdc52c17c85de7cd3bc0da Mon Sep 17 00:00:00 2001 From: Naveed Massjouni Date: Wed, 18 Jan 2012 19:31:01 +0000 Subject: Validating image id for rebuild. bug: 886701 Change-Id: I20ad03edca390af9203569e02ae0c1af5bb7beaf --- nova/api/openstack/compute/servers.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index 0d8165784..988b403b1 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -1081,6 +1081,9 @@ class Controller(wsgi.Controller): except exception.InstanceNotFound: msg = _("Instance could not be found") raise exc.HTTPNotFound(explanation=msg) + except exception.ImageNotFound as error: + msg = _("Cannot find image for rebuild") + raise exc.HTTPBadRequest(explanation=msg) instance = self._get_server(context, id) -- cgit