def check_exists(name, path):
    cmd = [_get_cmd(), '--display', name]
    out = __salt__['cmd.run_all'](cmd, python_shell=False)

    if out['retcode'] > 0 and out['stderr'] != '':
        return False

    return any((line.startswith(path) for line in out['stdout'].splitlines()))
Check if the given path is an alternative for a name.
dataset/ETHPy150Open saltstack/salt/salt/modules/alternatives.py/check_exists