From c1ef86ec7bd415fc86892f22df21f322d913cd52 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Wed, 10 Apr 2013 21:16:15 +0000 Subject: Don't hide stacktraces for unexpected errors in rescue Prevent rescue commands from hiding stacktraces for unexpected errors. Before this the wrap_errors function would catch unexpected errors and hide them, with a generic HTTPInternalServerError without any stacktrace. Change-Id: I80e0ae8257117a3e5a4c946b38870aad0e58cc12 --- nova/api/openstack/compute/contrib/rescue.py | 2 -- nova/api/openstack/extensions.py | 12 ------------ 2 files changed, 14 deletions(-) (limited to 'nova/api') diff --git a/nova/api/openstack/compute/contrib/rescue.py b/nova/api/openstack/compute/contrib/rescue.py index 87d838bdf..26b35b6be 100644 --- a/nova/api/openstack/compute/contrib/rescue.py +++ b/nova/api/openstack/compute/contrib/rescue.py @@ -45,7 +45,6 @@ class RescueController(wsgi.Controller): raise exc.HTTPNotFound(msg) @wsgi.action('rescue') - @exts.wrap_errors def _rescue(self, req, id, body): """Rescue an instance.""" context = req.environ["nova.context"] @@ -70,7 +69,6 @@ class RescueController(wsgi.Controller): return {'adminPass': password} @wsgi.action('unrescue') - @exts.wrap_errors def _unrescue(self, req, id, body): """Unrescue an instance.""" context = req.environ["nova.context"] diff --git a/nova/api/openstack/extensions.py b/nova/api/openstack/extensions.py index b2cdacd1e..e7c806388 100644 --- a/nova/api/openstack/extensions.py +++ b/nova/api/openstack/extensions.py @@ -309,18 +309,6 @@ class ResourceExtension(object): self.inherits = inherits -def wrap_errors(fn): - """Ensure errors are not passed along.""" - def wrapped(*args, **kwargs): - try: - return fn(*args, **kwargs) - except webob.exc.HTTPException: - raise - except Exception: - raise webob.exc.HTTPInternalServerError() - return wrapped - - def load_standard_extensions(ext_mgr, logger, path, package, ext_list=None): """Registers all standard API extensions.""" -- cgit