From: Mark Kirkwood Date: Wed, 6 Nov 2013 02:15:12 +0000 (+1300) Subject: Fix issue #6701. Use shutil.move instead of os.rename. X-Git-Tag: v1.3.1~2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8b2f7f88631fc8e08761815dc5f19bea4a2c3996;p=ceph-deploy.git Fix issue #6701. Use shutil.move instead of os.rename. --- diff --git a/ceph_deploy/hosts/remotes.py b/ceph_deploy/hosts/remotes.py index 76789cf..55d0564 100644 --- a/ceph_deploy/hosts/remotes.py +++ b/ceph_deploy/hosts/remotes.py @@ -1,6 +1,7 @@ import errno import socket import os +import shutil import tempfile import platform @@ -50,7 +51,8 @@ def write_conf(cluster, conf, overwrite): if old != conf and not overwrite: raise RuntimeError(err_msg) tmp_file.write(conf) - os.rename(tmp_file.name, path) + tmp_file.close() + shutil.move(tmp_file.name, path) return if os.path.exists('/etc/ceph'): with open(path, 'w') as f: