mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
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:
committed by
Michael DeHaan
parent
f876d51c66
commit
caf6bd6ce5
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user