Merge pull request #2486 from mcls/fix-copy-with-remote-src

Fix copy with the remote_src option
This commit is contained in:
Brian Coca 2015-11-20 11:59:32 -08:00
commit 1ff0704c0c

View file

@ -310,7 +310,7 @@ def main():
if rc != 0: if rc != 0:
module.fail_json(msg="failed to validate: rc:%s error:%s" % (rc,err)) module.fail_json(msg="failed to validate: rc:%s error:%s" % (rc,err))
if remote_src: if remote_src:
tmpdest = tempfile.mkstemp(dir=os.basedir(dest)) _, tmpdest = tempfile.mkstemp(dir=os.path.dirname(dest))
shutil.copy2(src, tmpdest) shutil.copy2(src, tmpdest)
module.atomic_move(tmpdest, dest) module.atomic_move(tmpdest, dest)
else: else: