-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dereference symlinks to set proper __cli opt (bsc#1215963) (#611)
* Dereference symlinks to set proper __cli * Add changelog entry * Add unit tests to check path is expanded --------- Co-authored-by: vzhestkov <[email protected]>
- Loading branch information
Showing
4 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Dereference symlinks to set proper __cli opt |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import salt.config | ||
from tests.support.mock import MagicMock, patch | ||
|
||
|
||
def test___cli_path_is_expanded(): | ||
defaults = salt.config.DEFAULT_MASTER_OPTS.copy() | ||
overrides = {} | ||
with patch( | ||
"salt.utils.path.expand", MagicMock(return_value="/path/to/testcli") | ||
) as expand_mock: | ||
opts = salt.config.apply_master_config(overrides, defaults) | ||
assert expand_mock.called | ||
assert opts["__cli"] == "testcli" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import salt.config | ||
from tests.support.mock import MagicMock, patch | ||
|
||
|
||
def test___cli_path_is_expanded(): | ||
defaults = salt.config.DEFAULT_MINION_OPTS.copy() | ||
overrides = {} | ||
with patch( | ||
"salt.utils.path.expand", MagicMock(return_value="/path/to/testcli") | ||
) as expand_mock: | ||
opts = salt.config.apply_minion_config(overrides, defaults) | ||
assert expand_mock.called | ||
assert opts["__cli"] == "testcli" |