mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #6597 from tarka/handle-uncreated-symlink-tmpfile
Handle missing symlink tempfile
This commit is contained in:
commit
2ddb251538
1 changed files with 2 additions and 1 deletions
|
@ -309,7 +309,8 @@ def main():
|
||||||
os.symlink(src, tmppath)
|
os.symlink(src, tmppath)
|
||||||
os.rename(tmppath, path)
|
os.rename(tmppath, path)
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
os.unlink(tmppath)
|
if os.path.exists(tmppath):
|
||||||
|
os.unlink(tmppath)
|
||||||
module.fail_json(path=path, msg='Error while replacing: %s' % str(e))
|
module.fail_json(path=path, msg='Error while replacing: %s' % str(e))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue