diff options
author | Jordan Borean <jborean93@gmail.com> | 2018-04-06 07:18:53 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-06 07:18:53 +1000 |
commit | 37901bba41702b1398360cfc7798c8bcacd88f36 (patch) | |
tree | feb0d9acae7bd013afac803dff4fe55d97750e2a | |
parent | 971697052b4ba317f8e22fa1bd59e2198a18b325 (diff) | |
download | ansible-37901bba41702b1398360cfc7798c8bcacd88f36.tar.gz |
win_copy: added fix for win_copy deleting local tmp folder (#37978)
-rw-r--r-- | CHANGELOG.md | 11 | ||||
-rw-r--r-- | lib/ansible/plugins/action/win_copy.py | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 36f587450c..a34f2d90fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,17 @@ Ansible Changes By Release ========================== +<a id="2.4.5"></a> + +## 2.4.5 "Dancing Days" - TBD + +### Bugfixes + +* Fix win_copy to preserve the global Ansible local tmp path instead of + deleting it when dealing with multiple files + (https://github.com/ansible/ansible/pull/37964) + + <a id="2.4.4"></a> ## 2.4.4 "Dancing Days" - 2018-04-04 diff --git a/lib/ansible/plugins/action/win_copy.py b/lib/ansible/plugins/action/win_copy.py index ac0367df24..d4619adf71 100644 --- a/lib/ansible/plugins/action/win_copy.py +++ b/lib/ansible/plugins/action/win_copy.py @@ -11,6 +11,7 @@ import base64 import json import os import os.path +import shutil import tempfile import traceback import zipfile @@ -320,11 +321,10 @@ class ActionModule(ActionBase): ) ) copy_args.pop('content', None) - os.remove(zip_path) - os.removedirs(os.path.dirname(zip_path)) module_return = self._execute_module(module_args=copy_args, task_vars=task_vars) self._remove_tmp_path(tmp_path) + shutil.rmtree(os.path.dirname(zip_path)) return module_return def run(self, tmp=None, task_vars=None): |