Skip to content

Commit

Permalink
Merge pull request #256 from onefinestay/callargs-not-argspec
Browse files Browse the repository at this point in the history
getcallargs doesn't return an argspec
  • Loading branch information
mattbennett committed May 13, 2015
2 parents 17bc5d3 + c2de58c commit 3464e60
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions nameko/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_redacted_args(entrypoint, *args, **kwargs):
<argument-name>.<dict-key>[<list-index>]
:Returns:
A dictionary as returned by :func:`inspect.getargspec`, but with
A dictionary as returned by :func:`inspect.getcallargs`, but with
sensitive arguments or partial arguments redacted.
.. note::
Expand Down Expand Up @@ -75,8 +75,8 @@ def method(self, foo):
sensitive_variables = (sensitive_variables,)

method = getattr(entrypoint.container.service_cls, entrypoint.method_name)
argspec = inspect.getcallargs(method, None, *args, **kwargs)
del argspec['self']
callargs = inspect.getcallargs(method, None, *args, **kwargs)
del callargs['self']

def redact(data, keys):
key = keys[0]
Expand All @@ -97,10 +97,10 @@ def redact(data, keys):
elif list_index:
keys.append(int(list_index))

if keys[0] in argspec:
redact(argspec, keys)
if keys[0] in callargs:
redact(callargs, keys)

return argspec
return callargs


def fail_fast_imap(pool, call, items):
Expand Down

0 comments on commit 3464e60

Please sign in to comment.