Created
December 17, 2013 21:46
-
-
Save kaoskitn/8013138 to your computer and use it in GitHub Desktop.
kwargs not processed correctly. getting back entire dict of kwargs for a single kwarg's value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Salt module mymodule.py: | |
import logging | |
log = logging.getLogger() | |
def do_something(foo=None): | |
log.debug('FOO? {0}'.format(foo)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[DEBUG ] Command details {'tgt_type': 'glob', 'jid': '20131217213543992204', 'tgt': '*', 'ret': '', 'user': 'sudo_cari', 'arg': [{'foo': 'bar', '__kwarg__': True}], 'fun': 'mymodule.do_something'} | |
[DEBUG ] FOO? {'foo': 'bar', '__kwarg__': True} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code run from master | |
from salt.client import LocalClient | |
client = LocalClient() | |
kwargs = {'foo':'bar'} | |
client.cmd('*', 'mymodule.do_something', (), kwarg=kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment