Use _remote_is_local=True for local connection in synchronize (#40833)

* All instances of local connection should use _remote_is_local=True. Fixes #40551

* Switch to instance attribute for synchronize

* Add test that shows that synchronize _remote_is_local addresses tmpdir building
This commit is contained in:
Matt Martz 2018-05-30 15:28:11 -05:00 committed by Matt Davis
parent d0f43bc6f8
commit ad7ba91f75
2 changed files with 19 additions and 0 deletions

View file

@ -301,6 +301,9 @@ class ActionModule(ActionBase):
new_connection = connection_loader.get('local', self._play_context, new_stdin)
self._connection = new_connection
# Override _remote_is_local as an instance attribute specifically for the synchronize use case
# ensuring we set local tmpdir correctly
self._connection._remote_is_local = True
self._override_module_replaced_vars(task_vars)
# SWITCH SRC AND DEST HOST PER MODE