summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins/action/win_copy.py
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2018-03-27 16:20:10 +1000
committerGitHub <noreply@github.com>2018-03-27 16:20:10 +1000
commitb1ac65d95a504fd1fd78f3028ccc5a2fe635bb13 (patch)
tree81eed79ddfe8cca4da24eb28dc9c449dccfbb30c /lib/ansible/plugins/action/win_copy.py
parent68e44e082e9ae1a52668c228f093a9c2de6a9602 (diff)
downloadansible-b1ac65d95a504fd1fd78f3028ccc5a2fe635bb13.tar.gz
win_copy: added fix for win_copy deleting local tmp folder (#37964)
Diffstat (limited to 'lib/ansible/plugins/action/win_copy.py')
-rw-r--r--lib/ansible/plugins/action/win_copy.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/ansible/plugins/action/win_copy.py b/lib/ansible/plugins/action/win_copy.py
index 3b4616c755..0566b95940 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,12 +321,10 @@ class ActionModule(ActionBase):
)
)
copy_args.pop('content', None)
- os.remove(zip_path)
-
module_return = self._execute_module(module_name='copy',
module_args=copy_args,
task_vars=task_vars)
- os.removedirs(os.path.dirname(zip_path))
+ shutil.rmtree(os.path.dirname(zip_path))
return module_return
def run(self, tmp=None, task_vars=None):