pillar vs. --pillar command line options triggers test mode when using special pillar values
I have a strange issue with a tool (vagrant) that sets pillars with the pillar='
Running the same command line just with --pillar='
vagrant@XXX-dev-vm-e1e89d6918c2c2e1:~$ salt-call --version salt-call 2014.7.0 (Helium)
sudo salt-call state.highstate pillar='{"test":"\n"}' is somehow resulting in test=True
sudo salt-call state.highstate pillar='{"test":""}' or sudo salt-call state.highstate --pillar='{"test":"\n"}'
I'm confused, according to the documentation, "pillar" and not "--pillar" should be the correct option to go.
Just to keep you updated... I'm currently tracking down this issue... It looks as the pillar option doesn't get recognized when it contains a newline character...
Therefore I made a test in salt/cli/caller.py (ZeroMQCaller).
ZMQ Caller when called with pillar data without new line character... [] {'__pub_fun': 'state.highstate', 'pillar': {'test': 'a'}, '__pub_pid': 11910, '__pub_jid': '20150122182846794342', '__pub_tgt': 'salt-call'}
ZMQ Caller when called with pillar data containing newline characters ['pillar={"test":"\na"}'] {'__pub_fun': 'state.highstate', '__pub_jid': '20150122182910605553', '__pub_pid': 11963, '__pub_tgt': 'salt-call'}
... Digging deeper it looks like
salt.utils.args.parse_input(self.opts['arg']) ['pillar={"xxx":"\na"}']
doesn't translate the arguments correctly.
salt.utils.args.parse_input(self.opts['arg']) [{'pillar': {'xxx': 'a'}, 'kwarg': True}]
... and deeper in utils/args.py we can find the regex that matches kwargs
KWARG_REGEX = re.compile(r'^([^\d\W][\w.-])=(?!=)(.)$')
and that expression doesn't match multiline... Therefore, I think the multiline pillar issue should be fixed by extending the regex. However, it's not yet clear why the test mode gets enabled. Maybe this is somehow triggered because of the pillar data which gets passed in as argument and not kw argument (if its a multiline argument).
Any comments/ideas @pitatus and @rallytime
Cheers,
Thanks for including the additional info.. sorry don't have a suggestion but it needs to be looked at..
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.