Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

salt-ssh interprets kwargs as args #11609

Closed
johtso opened this issue Mar 27, 2014 · 4 comments · Fixed by #11733
Closed

salt-ssh interprets kwargs as args #11609

johtso opened this issue Mar 27, 2014 · 4 comments · Fixed by #11733
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt fixed-pls-verify fix is linked, bug author to confirm fix Salt-SSH severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around

Comments

@johtso
Copy link
Contributor

johtso commented Mar 27, 2014

salt-ssh 'baobab' state.sls git test=True
Process Process-1:
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/human/.virtualenvs/baobab/lib/python2.7/site-packages/salt/client/ssh/__init__.py", line 334, in handle_routine
    stdout, stderr, retcode = single.run()
  File "/Users/human/.virtualenvs/baobab/lib/python2.7/site-packages/salt/client/ssh/__init__.py", line 574, in run
    stdout, stderr, retcode = self.run_wfunc()
  File "/Users/human/.virtualenvs/baobab/lib/python2.7/site-packages/salt/client/ssh/__init__.py", line 646, in run_wfunc
    ret = json.dumps(self.wfuncs[self.fun](*self.arg))
  File "/Users/human/.virtualenvs/baobab/lib/python2.7/site-packages/salt/client/ssh/wrapper/state.py", line 39, in sls
    high, errors = st_.render_highstate({saltenv: mods})
  File "/Users/human/.virtualenvs/baobab/lib/python2.7/site-packages/salt/state.py", line 2382, in render_highstate
    statefiles = fnmatch.filter(self.avail[saltenv], sls_match)
KeyError: 'test=True'

salt-ssh then hangs and has to be stopped with a keyboard interrupt.

@basepi
Copy link
Contributor

basepi commented Mar 28, 2014

That's very strange! Which version of salt are you using? It appears that the argument is being parsed as an arg, not a kwarg, and so it's trying to use it for the saltenv argument.

Thanks for the report, we'll investigate.

@basepi basepi added this to the Outstanding Bugs milestone Mar 28, 2014
@johtso
Copy link
Contributor Author

johtso commented Mar 28, 2014

Happens with the latest version of salt 2014.1.0-4018-g9d82e8c

I have a feeling this is a troublesome spot: https://github.com/saltstack/salt/blob/develop/salt/client/ssh/__init__.py#L646

@johtso
Copy link
Contributor Author

johtso commented Mar 29, 2014

It seems that this is a general issue with the salt-ssh cli. There is no parsing of kwargs.

Another example, test=True was completely ignored when executing pkg.install:

❯ salt-ssh 'baobab' pkg.install fortune test=True
baobab:
    ----------
    fortune-mod:
        ----------
        new:
            1:1.99.1-4
        old:

    fortunes-min:
        ----------
        new:
            1:1.99.1-4
        old:

    librecode0:
        ----------
        new:
            3.6-18
        old:

@johtso johtso changed the title salt-ssh state.sls chokes on test=True kwarg salt-ssh interprets kwargs as args Mar 29, 2014
@basepi
Copy link
Contributor

basepi commented Mar 31, 2014

Ya, we're definitely not handling those kwargs right. Thanks for the update.

@jfindlay jfindlay added the Core relates to code central or existential to Salt label May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt fixed-pls-verify fix is linked, bug author to confirm fix Salt-SSH severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants