Return a list of refs that can be used as environments

def envs(ignore_cache=False):
    '''
    Return a list of refs that can be used as environments
    '''
    if not ignore_cache:
        env_cache = os.path.join(__opts__['cachedir'], 'svnfs/envs.p')
        cache_match = salt.fileserver.check_env_cache(__opts__, env_cache)
        if cache_match is not None:
            return cache_match
    ret = set()
    for repo in init():
        trunk = os.path.join(repo['repo'], repo['trunk'])
        if os.path.isdir(trunk):
            # Add base as the env for trunk
            ret.add('base')
        else:
            log.error(
                'svnfs trunk path \'%s\' does not exist in repo %s, no base '
                'environment will be provided by this remote',
                repo['trunk'], repo['url']
            )

        branches = os.path.join(repo['repo'], repo['branches'])
        if os.path.isdir(branches):
            ret.update(os.listdir(branches))
        else:
            log.error(
                'svnfs branches path \'%s\' does not exist in repo %s',
                repo['branches'], repo['url']
            )

        tags = os.path.join(repo['repo'], repo['tags'])
        if os.path.isdir(tags):
            ret.update(os.listdir(tags))
        else:
            log.error(
                'svnfs tags path \'%s\' does not exist in repo %s',
                repo['tags'], repo['url']
            )
    return [x for x in sorted(ret) if _env_is_exposed(x)]