def _get_dir_list(load):
    '''
    Get a list of all directories on the master
    '''
    if 'env' in load:
        # "env" is not supported; Use "saltenv".
        load.pop('env')

    if 'saltenv' not in load or load['saltenv'] not in envs():
        return []
    ret = set()
    for repo in init():
        repo['repo'].open()
        ref = _get_ref(repo, load['saltenv'])
        if ref:
            manifest = repo['repo'].manifest(rev=ref[1])
            for tup in manifest:
                filepath = tup[4]
                split = filepath.rsplit('/', 1)
                while len(split) > 1:
                    relpath = os.path.relpath(split[0], repo['root'])
                    # Don't add '.'
                    if relpath != '.':
                        # Don't add files outside the hgfs_root
                        if not relpath.startswith('../'):
                            ret.add(os.path.join(repo['mountpoint'], relpath))
                    split = split[0].rsplit('/', 1)
        repo['repo'].close()
    if repo['mountpoint']:
        ret.add(repo['mountpoint'])
    return sorted(ret)
def _get_dir_list ( load ) : if 'env' in load : load . pop ( 'env' ) if 'saltenv' not in load or load [ 'saltenv' ] not in envs ( ) : return [ ] ret = set ( ) for repo in init ( ) : repo [ 'repo' ] . open ( ) ref = _get_ref ( repo , load [ 'saltenv' ] ) if ref : manifest = repo [ 'repo' ] . manifest ( rev = ref [ 1 ] ) for tup in manifest : filepath = tup [ 4 ] split = filepath . rsplit ( '/' , 1 ) while len ( split ) > 1 : relpath = os . path . relpath ( split [ 0 ] , repo [ 'root' ] ) if relpath != '.' : if not relpath . startswith ( '../' ) : ret . add ( os . path . join ( repo [ 'mountpoint' ] , relpath ) ) split = split [ 0 ] . rsplit ( '/' , 1 ) repo [ 'repo' ] . close ( ) if repo [ 'mountpoint' ] : ret . add ( repo [ 'mountpoint' ] ) return sorted ( ret )
Get a list of all directories on the master