mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-02 23:31:25 -07:00
create module tmpdir based on remote_tmp (#39833)
* create module tmpdir based on remote_tmp * Source remote_tmp from controller if possible * Fixed sanity test and not use lambda * Added expansion of env vars to the remote tmp * Fixed sanity issues * Added note around shell remote_tmp option * Changed fallback tmp dir to ~/.ansible/tmp to make shell defaults
This commit is contained in:
parent
1d640182c6
commit
44ab948e5d
5 changed files with 111 additions and 5 deletions
|
@ -414,12 +414,16 @@ class TestActionBase(unittest.TestCase):
|
|||
to_run.append(arg_path)
|
||||
return " ".join(to_run)
|
||||
|
||||
def get_option(option):
|
||||
return {}.get(option)
|
||||
|
||||
mock_connection = MagicMock()
|
||||
mock_connection.build_module_command.side_effect = build_module_command
|
||||
mock_connection.socket_path = None
|
||||
mock_connection._shell.get_remote_filename.return_value = 'copy.py'
|
||||
mock_connection._shell.join_path.side_effect = os.path.join
|
||||
mock_connection._shell.tmpdir = '/var/tmp/mytempdir'
|
||||
mock_connection._shell.get_option = get_option
|
||||
|
||||
# we're using a real play context here
|
||||
play_context = PlayContext()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue