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

Handle missing symlink tempfile
This commit is contained in:
Michael DeHaan 2014-03-28 11:11:32 -04:00
commit 2ddb251538

View file

@ -309,6 +309,7 @@ def main():
os.symlink(src, tmppath)
os.rename(tmppath, path)
except OSError, e:
if os.path.exists(tmppath):
os.unlink(tmppath)
module.fail_json(path=path, msg='Error while replacing: %s' % str(e))
else: