use shutil.move() instead of os.rename() to avoid OSError: [Errno 18] Invalid cross-device link

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-14 01:50:18 +02:00
parent 9b3a95e244
commit 03e312dcb7
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ class Cdist:
# Remove previous cache
if os.path.exists(self.cache_dir):
shutil.rmtree(self.cache_dir)
os.rename(self.temp_dir, self.cache_dir)
shutil.move(self.temp_dir, self.cache_dir)
def exit_error(self, *args):
log.error(*args)