Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cwd option not working with cmd.run and runas #51008
Description of Issue
I have arrived to this problem through the
These states are failing with the following comment:
running as root: cmd.run: - name: pwd - cwd: /Users/Carlos/Desktop running as user: cmd.run: - name: pwd - cwd: /Users/Carlos/Desktop - runas: Carlos powerlevel9k present: git.latest: - name: https://github.com/bhilburn/powerlevel9k.git - target: /Users/Carlos/.oh-my-zsh/custom/themes/powerlevel9k - user: Carlos - require: - oh-my-zsh present
(Provided by running
I have installed salt in my minion workstation with @Homebrew
brew install salt
man su DESCRIPTION ... -l Simulate a full login. The environment is discarded except for HOME, SHELL, PATH, TERM, and USER. HOME and SHELL are modified as above. USER is set to the target login. PATH is set to ``/bin:/usr/bin''. TERM is imported from your current environment. The invoked shell is the target login's, and su will change directory to the target login's home directory. ...
I don't know a different solution rather than chaining the
* upstream/develop: (156 commits) Set os and os_family in test_run_cwd_in_combination_with_runas Fix test_run_cwd_in_combination_with_runas Add multiple retries and timeout for getting vm resources in proxmox cloud. Fixes saltstack#49485 Fix issue saltstack#51008 Adding in Windows related core grain code that got removed in merge. Ensure the refresh_pillar is run against both the minion and sub_minion, otherwise minion_blackout pillar value is left behind for the sub_minion. Update codeauthor email Optionally include line number in caller_name Allow clone_from setting in proxmox salt-cloud to be an integer as per documentation Prevent valid return from virt-what creating unhandled exceptions Fix mocking Lint fix Stop using the deprecated `salt.transport.Channel.factory` Bugfix: setting empty 'webhook' option in test_no_webhook Bugfix: checking webhook is empty or None Bugfix: typo custom_grains Fix: __grains__ contents in test_generate_payload Fix PyLint: remove unused imports Add Visual Studio Code IDE to .gitignore Fix: test_generate_payload ...
I'm having the same problem on Windows with Salt 2018.3.3.
Still seeing this behavior in 2019.2 (we just attempted to upgrade from 2017.7)
Since the git execution module piggybacks on cmd.run for execution, this effectively means that the git module is completely unusable on macOS since the 2018.3.2 release. While a workaround exists for users of the cmd.run module itself, no such workaround exists for the git module.
Seems like this should be 'High Severity' per https://docs.saltstack.com/en/latest/topics/development/labels.html