diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-03-06 16:56:03 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-03-06 16:56:03 +0000 |
commit | 48c6d3712b58e0d106b27b2e9221a743d363569b (patch) | |
tree | 815c6e4ff360edb5fe5113a8677f964cd735e20c /nova/utils.py | |
parent | 4203ae186d4fdcd87227d34a01585cc8adf72e84 (diff) | |
parent | 1d5154ed0d907f2164f483583b8f15989a9eddc7 (diff) | |
download | nova-48c6d3712b58e0d106b27b2e9221a743d363569b.tar.gz nova-48c6d3712b58e0d106b27b2e9221a743d363569b.tar.xz nova-48c6d3712b58e0d106b27b2e9221a743d363569b.zip |
Merge "Remove parameters containing passwords from Notifications."
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 5afdf52fd..eb6c44106 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -1383,39 +1383,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""" |