This fixes copy with the remote_src option

It was broken in 6e37f1dcef when the remote_src was added. Need to
pass the absolute path to copy2 instead of a tuple.
This commit is contained in:
Maarten Claes 2015-11-18 13:12:59 +01:00 committed by Matt Clay
parent e1d0f3ff59
commit e0b8b0d789

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: