Gets the repo details for a given team as a dict from repo_name to repo details.
    Note that repo names are always in lower case.

    team_name
        The name of the team from which to list repos.

    profile
        The name of the profile configuration to use. Defaults to ``github``.

    ignore_cache
        Bypasses the use of cached team repos.

    CLI Example:

    .. code-block:: bash

        salt myminion github.list_team_repos 'team_name'

    .. versionadded:: 2016.11.0

def list_team_repos(team_name, profile="github", ignore_cache=False):
    '''
    Gets the repo details for a given team as a dict from repo_name to repo details.
    Note that repo names are always in lower case.

    team_name
        The name of the team from which to list repos.

    profile
        The name of the profile configuration to use. Defaults to ``github``.

    ignore_cache
        Bypasses the use of cached team repos.

    CLI Example:

    .. code-block:: bash

        salt myminion github.list_team_repos 'team_name'

    .. versionadded:: 2016.11.0
    '''
    cached_team = get_team(team_name, profile=profile)
    if not cached_team:
        log.error('Team %s does not exist.', team_name)
        return False

    # Return from cache if available
    if cached_team.get('repos') and not ignore_cache:
        return cached_team.get('repos')

    try:
        client = _get_client(profile)
        organization = client.get_organization(
            _get_config_value(profile, 'org_name')
        )
        team = organization.get_team(cached_team['id'])
    except UnknownObjectException:
        log.exception('Resource not found: %s', cached_team['id'])
    try:
        repos = {}
        for repo in team.get_repos():
            permission = 'pull'
            if repo.permissions.admin:
                permission = 'admin'
            elif repo.permissions.push:
                permission = 'push'

            repos[repo.name.lower()] = {
                'permission': permission
            }
        cached_team['repos'] = repos
        return repos
    except UnknownObjectException:
        log.exception('Resource not found: %s', cached_team['id'])
        return []