mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-06 13:22:58 +00:00
Pass absolute paths to atmoic_move(). (#799)
This commit is contained in:
@@ -92,7 +92,7 @@ def write_file(module, content, default_mode=None, path=None):
|
||||
if os.path.exists(file_args['path']):
|
||||
module.set_fs_attributes_if_different(file_args, False)
|
||||
# Move tempfile to final destination
|
||||
module.atomic_move(tmp_name, file_args['path'])
|
||||
module.atomic_move(os.path.abspath(tmp_name), os.path.abspath(file_args['path']))
|
||||
# Try to update permissions again
|
||||
if not module.check_file_absent_if_check_mode(file_args['path']):
|
||||
module.set_fs_attributes_if_different(file_args, False)
|
||||
|
||||
Reference in New Issue
Block a user