def vo_from_fqan(fqan):
    """
    Get the VO from a full FQAN

    Args:
        fqan: A single fqans (i.e. /dteam/cern/Role=lcgadmin)
    Returns:
        The vo + group (i.e. dteam/cern)
    """
    components = fqan.split('/')[1:]
    groups = []
    for c in components:
        if c.lower().startswith('role='):
            break
        groups.append(c)
    return '/'.join(groups)