mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
windows async changes and tests (#17400)
This commit is contained in:
parent
056a7cb957
commit
f239e1e61f
5 changed files with 277 additions and 15 deletions
|
@ -254,10 +254,15 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
|
||||
return rc
|
||||
|
||||
def _should_remove_tmp_path(self, tmp_path):
|
||||
'''Determine if temporary path should be deleted or kept by user request/config'''
|
||||
|
||||
return tmp_path and self._cleanup_remote_tmp and not C.DEFAULT_KEEP_REMOTE_FILES and "-tmp-" in tmp_path
|
||||
|
||||
def _remove_tmp_path(self, tmp_path):
|
||||
'''Remove a temporary path we created. '''
|
||||
|
||||
if tmp_path and self._cleanup_remote_tmp and not C.DEFAULT_KEEP_REMOTE_FILES and "-tmp-" in tmp_path:
|
||||
if self._should_remove_tmp_path(tmp_path):
|
||||
cmd = self._connection._shell.remove(tmp_path, recurse=True)
|
||||
# If we have gotten here we have a working ssh configuration.
|
||||
# If ssh breaks we could leave tmp directories out on the remote system.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue