def scan_dir(d):
    """Look in the supplied directory for a vendor or WORKSPACE entry.

    Args:
      d: full path to directory to be scanned.

    Returns:
      Success (boolean) and Full Path.
    """
    success = False
    path = ""

    if d.get_child("vendor").exists:
        # vendor exists, this is our match.  Return it to the caller as success
        path = d.get_child("vendor")
        success = True
    elif d.get_child("WORKSPACE").exists:
        # We should stop looking if we've reached the workspace root
        path = ""
        success = True

    return (success, path)