mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Make Salt-SSH sync custom utils
This commit is contained in:
parent
9f5a1a7f4b
commit
fbb6728179
3 changed files with 36 additions and 0 deletions
1
changelog/53666.added.md
Normal file
1
changelog/53666.added.md
Normal file
|
@ -0,0 +1 @@
|
|||
Made salt-ssh sync custom utils
|
|
@ -1802,6 +1802,7 @@ def mod_data(fsclient):
|
|||
"grains",
|
||||
"renderers",
|
||||
"returners",
|
||||
"utils",
|
||||
]
|
||||
ret = {}
|
||||
with fsclient:
|
||||
|
|
|
@ -319,3 +319,37 @@ def test_wrapper_unwrapped_command_invalid_return(salt_ssh_cli):
|
|||
assert ret.data["parsed"] == {
|
||||
"local": {"no_return_key_present": "Chaos is a ladder though"}
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def utils_dependent_module(salt_run_cli, salt_master):
|
||||
module_contents = r"""
|
||||
import customutilsmodule
|
||||
|
||||
|
||||
def __virtual__():
|
||||
return "utilsync"
|
||||
|
||||
|
||||
def test():
|
||||
return customutilsmodule.test()
|
||||
"""
|
||||
utils_contents = r"""
|
||||
def test():
|
||||
return "success"
|
||||
"""
|
||||
module_tempfile = salt_master.state_tree.base.temp_file(
|
||||
"_modules/utilsync.py", contents=module_contents
|
||||
)
|
||||
util_tempfile = salt_master.state_tree.base.temp_file(
|
||||
"_utils/customutilsmodule.py", contents=utils_contents
|
||||
)
|
||||
with module_tempfile, util_tempfile:
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("utils_dependent_module")
|
||||
def test_custom_utils_are_present_on_target(salt_ssh_cli):
|
||||
ret = salt_ssh_cli.run("utilsync.test")
|
||||
assert ret.returncode == 0
|
||||
assert ret.data == "success"
|
||||
|
|
Loading…
Add table
Reference in a new issue