From 3b0d8646838209b56f7cce4e1a7e47be0010df63 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 7 Feb 2018 16:11:32 -0500 Subject: [PATCH] fix keep remote files --- lib/ansible/plugins/action/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/plugins/action/__init__.py b/lib/ansible/plugins/action/__init__.py index ce0f26f7a42..e7860f46a0f 100644 --- a/lib/ansible/plugins/action/__init__.py +++ b/lib/ansible/plugins/action/__init__.py @@ -298,6 +298,9 @@ class ActionBase(with_metaclass(ABCMeta, object)): def _remove_tmp_path(self, tmp_path): '''Remove a temporary path we created. ''' + if tmp_path is None and self._connection._shell.tempdir: + tmp_path = self._connection._shell.tempdir + 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.