[entropy.server] fix typo in rename() logic, call shutil.move() only if -EXDEV

This commit is contained in:
Fabio Erculiani
2011-10-30 19:31:37 +01:00
parent 9647d67af2
commit 6aed62012c

View File

@@ -2256,7 +2256,8 @@ class Server(Client):
os.rename(package_path, new_package_path)
except OSError as err:
if err.errno != errno.EXDEV:
shutil.move(package_path, new_package_path)
raise
shutil.move(package_path, new_package_path)
# update database
dbconn.setDownloadURL(idpackage, download_url)