diff options
author | Sandy Walsh <sandy@sandywalsh.com> | 2013-02-21 10:21:39 -0400 |
---|---|---|
committer | Sandy Walsh <sandy.walsh@rackspace.com> | 2013-03-05 16:27:29 -0400 |
commit | 1d5154ed0d907f2164f483583b8f15989a9eddc7 (patch) | |
tree | 6f79dac702c3c4a54b0badbf1cf1e675f0c182bd /nova/utils.py | |
parent | a246cb90d229aea5cf70d886ad76061d5ad59010 (diff) | |
download | nova-1d5154ed0d907f2164f483583b8f15989a9eddc7.tar.gz nova-1d5154ed0d907f2164f483583b8f15989a9eddc7.tar.xz nova-1d5154ed0d907f2164f483583b8f15989a9eddc7.zip |
Remove parameters containing passwords from Notifications.
compute.manager methods often takes password parameters in methods
that are wrapped with exception handlers and notifiers. What can
happen is these passwords will get bundled up and sent outside of
the system.
This patch will strip out any parameter with *_pass* in the name.
The side effect of this is that all notification will have the
error parameters in the 'args' part of the notification payload.
Previously only the positional args were in the 'args' part and
keyword args were placed in the payload directly.
This may affect consumers of the error notifications.
Change-Id: I2e7822eb5416d315ceb690f739e4dba9d52a7954
Diffstat (limited to 'nova/utils.py')
-rw-r--r-- | nova/utils.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/nova/utils.py b/nova/utils.py index 764fa9070..a39d270d4 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -1381,39 +1381,6 @@ def get_wrapped_function(function): return _get_wrapped_function(function) -def getcallargs(function, *args, **kwargs): - """This is a simplified inspect.getcallargs (2.7+). - - It should be replaced when python >= 2.7 is standard. - """ - keyed_args = {} - argnames, varargs, keywords, defaults = inspect.getargspec(function) - - keyed_args.update(kwargs) - - #NOTE(alaski) the implicit 'self' or 'cls' argument shows up in - # argnames but not in args or kwargs. Uses 'in' rather than '==' because - # some tests use 'self2'. - if 'self' in argnames[0] or 'cls' == argnames[0]: - # The function may not actually be a method or have im_self. - # Typically seen when it's stubbed with mox. - if inspect.ismethod(function) and hasattr(function, 'im_self'): - keyed_args[argnames[0]] = function.im_self - else: - keyed_args[argnames[0]] = None - - remaining_argnames = filter(lambda x: x not in keyed_args, argnames) - keyed_args.update(dict(zip(remaining_argnames, args))) - - if defaults: - num_defaults = len(defaults) - for argname, value in zip(argnames[-num_defaults:], defaults): - if argname not in keyed_args: - keyed_args[argname] = value - - return keyed_args - - class ExceptionHelper(object): """Class to wrap another and translate the ClientExceptions raised by its function calls to the actual ones""" |