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

Handle missing symlink tempfile
reviewable/pr18780/r1
Michael DeHaan 11 years ago
commit 38c3332b8a

@ -309,6 +309,7 @@ def main():
os.symlink(src, tmppath) os.symlink(src, tmppath)
os.rename(tmppath, path) os.rename(tmppath, path)
except OSError, e: except OSError, e:
if os.path.exists(tmppath):
os.unlink(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:

Loading…
Cancel
Save