Changed atomic_replace to atomic_move, now ti DOES move atomically in the last

step
Signed-off-by: Brian Coca <briancoca+dev@gmail.com>
This commit is contained in:
Brian Coca 2013-04-23 21:52:23 -04:00 committed by Michael DeHaan
commit caf6bd6ce5
6 changed files with 34 additions and 26 deletions

View file

@ -110,10 +110,10 @@ def write_sysctl(module, lines, **sysctl_args):
module.fail_json(msg="Failed to write to file %s: %s" % (tmp_path, str(e)))
f.flush()
f.close()
# replace the real one
module.atomic_replace(tmp_path, sysctl_args['sysctl_file'])
module.atomic_move(tmp_path, sysctl_args['sysctl_file'])
# end
return sysctl_args