Commit 494d2b27 authored by Antoine Catton's avatar Antoine Catton

FIX: Use shutil.move instead of os.rename in downloader recipe

os.rename failed when it move the file across devices/mount-points.
shutil.move allow to rename/move a file from one physical device to
another.
parent 27fcf7ab
......@@ -59,7 +59,7 @@ def service(args):
return 127 # Not-null return code
if not args['archive']:
os.rename(tmpoutput, args['output'])
shutil.move(tmpoutput, args['output'])
else:
# XXX: hardcoding path
extract_dir = os.path.join(tmpdir, 'extract')
......@@ -74,8 +74,8 @@ def service(args):
if len(archive_content) == 1 and \
os.path.isfile(os.path.join(extract_dir,
archive_content[0])):
os.rename(os.path.join(extract_dir,
archive_content[0]),
shutil.move(os.path.join(extract_dir,
archive_content[0]),
args['output'])
else:
return 127 # Not-null return code
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment