Warn when salt-call --file-root/--pillar-root/--states-dir ignored (#68137)#69434
Open
dwoz wants to merge 1 commit into
Open
Warn when salt-call --file-root/--pillar-root/--states-dir ignored (#68137)#69434dwoz wants to merge 1 commit into
dwoz wants to merge 1 commit into
Conversation
salt-call's --file-root, --pillar-root, and --states-dir options silently had no observable effect when --local was not also passed. These flags only update the local minion's file_roots, pillar_roots, and states_dirs config; the remote file client then retrieves state and pillar data from the master and HighState.__gen_opts() in salt/state.py overwrites the local file_roots with master_opts' file_roots, so the user-supplied directories were ignored without any indication. Emit a single stderr warning naming the ignored option(s) and pointing the user at --local. No control-flow changes; the underlying config keys are still populated so behaviour with --local is unchanged. Fixes saltstack#68137
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
salt-callaccepted--file-root,--pillar-root, and--states-dirwithout
--localbut silently dropped the overrides — the remote fileclient retrieves state and pillar data from the master and
HighState.__gen_opts()overwritesfile_rootswith the master'svalues. Now the CLI emits a single stderr warning naming the ignored
option(s) and pointing the user at
--local. The underlying configkeys are still populated so behaviour with
--localis unchanged.What issues does this PR fix or reference?
Fixes #68137
Previous Behavior
ran against the master's
/srv/saltwith no indication that--file-roothad no effect.New Behavior
Merge requirements satisfied?
doc/ref/cli/salt-call.rsttext matches the newbehaviour; option still does what it says when
--localis set)changelog/68137.fixed.md)tests/pytests/unit/cli/test_call.py,five new tests covering each option plus negative cases)
Commits signed with GPG?
No