From fa16f2b68603be04cb5f4e915625181ac6c119eb Mon Sep 17 00:00:00 2001 From: Jay Pipes Date: Wed, 26 Dec 2012 14:53:53 -0500 Subject: Remove improper NotFound except block in list servers Added a couple tests to verify that NotFound was actually never raised when no results are returned from list servers or list servers details, and then removed the except blocks from the controller. Change-Id: I36856066b9e4c4e3f7b85ddf8facb35204034838 fixes: lp bug #1089385 --- nova/api/openstack/compute/servers.py | 6 ------ 1 file changed, 6 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index a62740681..c36d53993 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -452,9 +452,6 @@ class Controller(wsgi.Controller): servers = self._get_servers(req, is_detail=False) except exception.Invalid as err: raise exc.HTTPBadRequest(explanation=str(err)) - except exception.NotFound: - msg = _("Instance could not be found") - raise exc.HTTPNotFound(explanation=msg) return servers @wsgi.serializers(xml=ServersTemplate) @@ -464,9 +461,6 @@ class Controller(wsgi.Controller): servers = self._get_servers(req, is_detail=True) except exception.Invalid as err: raise exc.HTTPBadRequest(explanation=str(err)) - except exception.NotFound as err: - msg = _("Instance could not be found") - raise exc.HTTPNotFound(explanation=msg) return servers def _add_instance_faults(self, ctxt, instances): -- cgit