From 8b2f7f88631fc8e08761815dc5f19bea4a2c3996 Mon Sep 17 00:00:00 2001 From: Mark Kirkwood Date: Wed, 6 Nov 2013 15:15:12 +1300 Subject: [PATCH] Fix issue #6701. Use shutil.move instead of os.rename. --- ceph_deploy/hosts/remotes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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: -- 2.47.3