From 5f1e2afc34973b73ca8f18004716ba005c46305f Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Thu, 18 Apr 2013 15:46:42 -0400 Subject: [PATCH] Revert "make atomic_replace use shutil.copy2 instead of os.rename() so it will work across filesystems". AR function was leaving some tmp files behind, want to revert, will have better implementation soon, this is the old way now. This reverts commit f74a1fa4f0b1a928a85c1316dfceb42637624a2f. --- lib/ansible/module_common.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/ansible/module_common.py b/lib/ansible/module_common.py index 508fe93de1..8e221ad9e7 100644 --- a/lib/ansible/module_common.py +++ b/lib/ansible/module_common.py @@ -797,11 +797,7 @@ class AnsibleModule(object): if self.selinux_enabled(): context = self.selinux_default_context(dest) self.set_context_if_different(src, context, False) - try: - shutil.copy2(src, dest) - except shutil.Error, e: - self.fail_json(msg='Could not atomic_replace file: %s to %s: %s' % (src, dest, e)) - + os.rename(src, dest) def run_command(self, args, check_rc=False, close_fds=False, executable=None, data=None): '''