1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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 f74a1fa4f0.
This commit is contained in:
Michael DeHaan 2013-04-18 15:46:42 -04:00
parent 3238d0947d
commit 5f1e2afc34

View file

@ -797,11 +797,7 @@ class AnsibleModule(object):
if self.selinux_enabled(): if self.selinux_enabled():
context = self.selinux_default_context(dest) context = self.selinux_default_context(dest)
self.set_context_if_different(src, context, False) self.set_context_if_different(src, context, False)
try: os.rename(src, dest)
shutil.copy2(src, dest)
except shutil.Error, e:
self.fail_json(msg='Could not atomic_replace file: %s to %s: %s' % (src, dest, e))
def run_command(self, args, check_rc=False, close_fds=False, executable=None, data=None): def run_command(self, args, check_rc=False, close_fds=False, executable=None, data=None):
''' '''