[BUG] salt converts 'false', 'off' to False, 'true', 'on' to True for cmd.run and cmd.run_all
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Sorry if this has been fixed already, given the keywords it's difficult to search.
Description
The salt command is being overzealous by converting command names to Python values as described above,
Setup
I think the setup is irrelevant, as this seems to be happening on the command line.
Steps to Reproduce the behavior
[root@singlenode tmp]# salt '*' cmd.run 'false'
6287c6e3-f7d1-46e5-b216-8219e5a938de:
/bin/sh: False: command not found
ERROR: Minions returned with non-zero exit code
[root@singlenode tmp]# salt '*' cmd.run_all 'on'
6287c6e3-f7d1-46e5-b216-8219e5a938de:
----------
pid:
762624
retcode:
127
stderr:
/bin/sh: True: command not found
stdout:
ERROR: Minions returned with non-zero exit code
Expected behavior
Commands false and on should be run instead of False and True.
Versions Report
salt-3002.2-1.el7.noarch
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Salt command-line handling for cmd.run and cmd.run_all, then reproduce the reported commands using the issue's examples. Trace where the command argument is converted before execution; done means false, off, true, and on are passed as literal command text and the examples no longer invoke False or True.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100