def _unlock_cache(w_lock):
    '''
    Unlock a FS file/dir based lock
    '''
    if not os.path.exists(w_lock):
        return
    try:
        if os.path.isdir(w_lock):
            os.rmdir(w_lock)
        elif os.path.isfile(w_lock):
            os.unlink(w_lock)
    except (OSError, __HOLE__) as exc:
        log.trace('Error removing lockfile {0}: {1}'.format(w_lock, exc))
dataset/ETHPy150Open saltstack/salt/salt/fileserver/__init__.py/_unlock_cache