From e0b8b0d789ac314875bf3aa23f1496a6986b7d03 Mon Sep 17 00:00:00 2001 From: Maarten Claes Date: Wed, 18 Nov 2015 13:12:59 +0100 Subject: [PATCH] This fixes copy with the remote_src option It was broken in 6e37f1dcef0 when the remote_src was added. Need to pass the absolute path to copy2 instead of a tuple. --- lib/ansible/modules/files/copy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/files/copy.py b/lib/ansible/modules/files/copy.py index 812b2d9ab7d..5dd1e9935e6 100644 --- a/lib/ansible/modules/files/copy.py +++ b/lib/ansible/modules/files/copy.py @@ -310,7 +310,7 @@ def main(): if rc != 0: module.fail_json(msg="failed to validate: rc:%s error:%s" % (rc,err)) if remote_src: - tmpdest = tempfile.mkstemp(dir=os.basedir(dest)) + _, tmpdest = tempfile.mkstemp(dir=os.path.dirname(dest)) shutil.copy2(src, tmpdest) module.atomic_move(tmpdest, dest) else: