From 7e006ca39fc57e35244f471c0f0bb6773fdbbc28 Mon Sep 17 00:00:00 2001 From: Andrew Laski Date: Thu, 18 Apr 2013 14:36:26 -0400 Subject: Don't swallow PolicyNotAuthorized for resize/reboot actions Removes 'except Exception' lines in the api which were preventing PolicyNotAuthorized exceptions from bubbling up and returning 403 to the caller. This addresses policy exceptions in confirmResize, revertResize, and reboot. The try block calls into the compute api which sends a cast to perform to bulk of the work, so there is little chance of an exception bubbling up which is not already being caught. Removes a unit test for a condition that should not exist. Bug 1170453 Change-Id: I516a19894ab3d183057c774e84c4faa7053a6463 --- nova/api/openstack/compute/servers.py | 9 --------- 1 file changed, 9 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index 12efa5eb4..cf200e50a 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -1031,9 +1031,6 @@ class Controller(wsgi.Controller): except exception.InstanceInvalidState as state_error: common.raise_http_conflict_for_instance_invalid_state(state_error, 'confirmResize') - except Exception, e: - LOG.exception(_("Error in confirm-resize %s"), e) - raise exc.HTTPBadRequest() return exc.HTTPNoContent() @wsgi.response(202) @@ -1054,9 +1051,6 @@ class Controller(wsgi.Controller): except exception.InstanceInvalidState as state_error: common.raise_http_conflict_for_instance_invalid_state(state_error, 'revertResize') - except Exception, e: - LOG.exception(_("Error in revert-resize %s"), e) - raise exc.HTTPBadRequest() return webob.Response(status_int=202) @wsgi.response(202) @@ -1084,9 +1078,6 @@ class Controller(wsgi.Controller): except exception.InstanceInvalidState as state_error: common.raise_http_conflict_for_instance_invalid_state(state_error, 'reboot') - except Exception, e: - LOG.exception(_("Error in reboot %s"), e, instance=instance) - raise exc.HTTPUnprocessableEntity() return webob.Response(status_int=202) def _resize(self, req, instance_id, flavor_id, **kwargs): -- cgit