def delete_if_exists(path, remove=os.unlink):

    try:
        remove(path)
    except OSError as e:
        if e.errno != errno.ENOENT:
            raise
Delete a file, but ignore file not found error.
dataset/ETHPy150Open openstack/solum/solum/openstack/common/fileutils.py/delete_if_exists