Prepare arguments for the module

This commit is contained in:
Bo Maryniuk 2017-09-12 15:33:37 +02:00
parent a77b8b4204
commit 5cfc32f471

View File

@ -124,8 +124,17 @@ def _set_callables(modules):
''' '''
Call an Ansible module as a function from the Salt. Call an Ansible module as a function from the Salt.
''' '''
kwargs = {}
if kw.get('__pub_arg'):
for _kw in kw.get('__pub_arg', []):
if isinstance(_kw, dict):
kwargs = _kw
break
else:
kw = {}
global _caller global _caller
return _caller.call(cmd_name) return _caller.call(cmd_name, *args, **kwargs)
_cmd.__doc__ = doc _cmd.__doc__ = doc
return _cmd return _cmd