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

cmd.exec_code_all cannot properly execute some shell/python/ruby snippet #28077

Closed
mscherer opened this issue Oct 19, 2015 · 7 comments
Closed
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Execution-Module P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Milestone

Comments

@mscherer
Copy link
Contributor

So I am trying to execute some shell fragments using cmd.exec_code_all, and it fail with a rather cryptic error message:

$ salt '*' cmd.exec_code_all shell 'LANG=C id'
kiora.example.com:
    ERROR executing 'cmd.exec_code_all': The following keyword arguments are not valid: LANG=C id

While I can work around this one since that's shell, the problem also exist for python:

salt '*' cmd.exec_code_all python 'a=1; print a'
kiora.example.com:
    ERROR executing 'cmd.exec_code_all': The following keyword arguments are not valid: a=1; print a

or even ruby:

salt '*' cmd.exec_code_all python 'a=1; puts a'
kiora.cdg.redhat.com:
    ERROR executing 'cmd.exec_code_all': The following keyword arguments are not valid: a=1; puts a
@mscherer mscherer changed the title cmd.exec_code_all cannot properly execute some shell:python/ruby snippet cmd.exec_code_all cannot properly execute some shell/python/ruby snippet Oct 19, 2015
@mscherer
Copy link
Contributor Author

That's againt the EPEL 7 version, so salt-master-2015.5.5-1.el7.noarch

@mscherer
Copy link
Contributor Author

~ $ salt --versions-report
           Salt: 2015.5.5
         Python: 2.7.5 (default, Aug  6 2015, 10:12:10)
         Jinja2: 2.7.2
       M2Crypto: 0.21.1
 msgpack-python: 0.4.6
   msgpack-pure: Not Installed
       pycrypto: 2.6.1
        libnacl: Not Installed
         PyYAML: 3.10
          ioflo: Not Installed
          PyZMQ: 14.3.1
           RAET: Not Installed
            ZMQ: 3.2.5
           Mako: 0.8.1
        Tornado: Not Installed
        timelib: Not Installed
       dateutil: 1.5

@jfindlay jfindlay added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Confirmed Salt engineer has confirmed bug/feature - often including a MCVE P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps Execution-Module labels Oct 19, 2015
@jfindlay jfindlay added this to the Approved milestone Oct 19, 2015
@jfindlay
Copy link
Contributor

@mscherer, thanks for the report. I have confirmed this on 2015.8.1 as well. It seems that salt is interpreting the a=1 statements as keyword arguments to cmd.exe_code[_all]. When I put spaces around the = token, it works as expected:

# salt '*' cmd.exec_code python 'a = 1; print a'
jmoney-main:
    1

@stale
Copy link

stale bot commented Jan 20, 2018

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.

@stale stale bot added the stale label Jan 20, 2018
@mscherer
Copy link
Contributor Author

I am no longer using salt, so I can't test any fix.

@stale
Copy link

stale bot commented Jan 20, 2018

Thank you for updating this issue. It is no longer marked as stale.

@stale stale bot removed the stale label Jan 20, 2018
@stale
Copy link

stale bot commented May 5, 2019

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.

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 Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Execution-Module P3 Priority 3 Platform Relates to OS, containers, platform-based utilities like FS, system based apps severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Projects
None yet
Development

No branches or pull requests

2 participants