Commit 2ddb2515 by Michael DeHaan

Merge pull request #6597 from tarka/handle-uncreated-symlink-tmpfile

Handle missing symlink tempfile 
parents 0bec29a6 e157355f
......@@ -309,7 +309,8 @@ def main():
os.symlink(src, tmppath)
os.rename(tmppath, path)
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))
else:
try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment