mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Pass absolute paths to atomic_move() (#8925)
Pass absolute paths to atmoic_move().
This commit is contained in:
@@ -214,7 +214,7 @@ def run_module(module, tmpdir, kwriteconfig):
|
||||
if module.params['backup'] and os.path.exists(b_path):
|
||||
result['backup_file'] = module.backup_local(result['path'])
|
||||
try:
|
||||
module.atomic_move(b_tmpfile, b_path)
|
||||
module.atomic_move(b_tmpfile, os.path.abspath(b_path))
|
||||
except IOError:
|
||||
module.ansible.fail_json(msg='Unable to move temporary file %s to %s, IOError' % (tmpfile, result['path']), traceback=traceback.format_exc())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user