Only unlink the symlink tempfile on error if it was created in the

previous operation.
pull/6597/head
Steve Smith 12 years ago
parent 2156e87e62
commit e157355fd6

@ -305,7 +305,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))
try:
if state == 'hard':

Loading…
Cancel
Save