mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07: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:
parent
f876d51c66
commit
caf6bd6ce5
6 changed files with 34 additions and 26 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue