summaryrefslogtreecommitdiffstats
path: root/nova/exception.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-01-14 19:41:51 +0000
committerGerrit Code Review <review@openstack.org>2013-01-14 19:41:51 +0000
commit09809b8c9336a4fec7bf525ce922d2529c88c4ca (patch)
tree5018417262e092ce2d0a8f604a0e1d726298834e /nova/exception.py
parent61b04d3aaf203667d6845304bbeab123c6bf37f1 (diff)
parentd1f121265badfffd097ee983d14989b885375a0e (diff)
downloadnova-09809b8c9336a4fec7bf525ce922d2529c88c4ca.tar.gz
nova-09809b8c9336a4fec7bf525ce922d2529c88c4ca.tar.xz
nova-09809b8c9336a4fec7bf525ce922d2529c88c4ca.zip
Merge "Keep self and context out of error notification payload."
Diffstat (limited to 'nova/exception.py')
-rw-r--r--nova/exception.py27
1 files changed, 4 insertions, 23 deletions
diff --git a/nova/exception.py b/nova/exception.py
index 7ec23d32d..f96b1eaf3 100644
--- a/nova/exception.py
+++ b/nova/exception.py
@@ -82,9 +82,11 @@ def wrap_exception(notifier=None, publisher_id=None, event_type=None,
# to pass it in as a parameter. Otherwise we get a cyclic import of
# nova.notifier.api -> nova.utils -> nova.exception :(
def inner(f):
- def wrapped(*args, **kw):
+ def wrapped(self, context, *args, **kw):
+ # Don't store self or context in the payload, it now seems to
+ # contain confidential information.
try:
- return f(*args, **kw)
+ return f(self, context, *args, **kw)
except Exception, e:
with excutils.save_and_reraise_exception():
if notifier:
@@ -104,10 +106,6 @@ def wrap_exception(notifier=None, publisher_id=None, event_type=None,
# propagated.
temp_type = f.__name__
- context = get_context_from_function_and_args(f,
- args,
- kw)
-
notifier.notify(context, publisher_id, temp_type,
temp_level, payload)
@@ -1089,20 +1087,3 @@ class CryptoCAFileNotFound(FileNotFound):
class CryptoCRLFileNotFound(FileNotFound):
message = _("The CRL file for %(project)s could not be found")
-
-
-def get_context_from_function_and_args(function, args, kwargs):
- """Find an arg of type RequestContext and return it.
-
- This is useful in a couple of decorators where we don't
- know much about the function we're wrapping.
- """
-
- # import here to avoid circularity:
- from nova import context
-
- for arg in itertools.chain(kwargs.values(), args):
- if isinstance(arg, context.RequestContext):
- return arg
-
- return None