Free 'fun' from the function signature namespace

'fun' is a common argument in Salt. format_call will choke if you
attempt to call a function that uses this argment. I.e.,:

>>> __salt__.saltutil.runner('mine.get', tgt='*', fun='network.ip_addrs', tgt_type='glob')
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: runner() got multiple values for keyword argument 'fun'
This commit is contained in:
Seth House 2015-08-25 15:08:02 -06:00 committed by rallytime
parent db30926ac9
commit 1af42eed36

View File

@ -795,7 +795,7 @@ def cmd_iter(tgt,
yield ret
def runner(fun, **kwargs):
def runner(_fun, **kwargs):
'''
Execute a runner module (this function must be run on the master)
@ -822,10 +822,10 @@ def runner(fun, **kwargs):
else:
rclient = salt.runner.RunnerClient(__opts__)
return rclient.cmd(fun, [], kwarg=kwargs)
return rclient.cmd(_fun, kwarg=kwargs)
def wheel(fun, **kwargs):
def wheel(_fun, **kwargs):
'''
Execute a wheel module (this function must be run on the master)
@ -843,7 +843,7 @@ def wheel(fun, **kwargs):
salt '*' saltutil.wheel key.accept match=jerry
'''
wclient = salt.wheel.WheelClient(__opts__)
return wclient.cmd(fun, kwarg=kwargs)
return wclient.cmd(_fun, kwarg=kwargs)
# this is the only way I could figure out how to get the REAL file_roots