def __gen_opts(self, opts_in, grains, saltenv=None, ext=None, pillarenv=None):
        '''
        The options need to be altered to conform to the file client
        '''
        opts = copy.deepcopy(opts_in)
        opts['file_client'] = 'local'
        if not grains:
            opts['grains'] = {}
        else:
            opts['grains'] = grains
        # Allow minion/CLI saltenv/pillarenv to take precedence over master
        opts['saltenv'] = saltenv \
            if saltenv is not None \
            else opts.get('saltenv')
        opts['pillarenv'] = pillarenv \
            if pillarenv is not None \
            else opts.get('pillarenv')
        opts['id'] = self.minion_id
        if opts['state_top'].startswith('salt://'):
            opts['state_top'] = opts['state_top']
        elif opts['state_top'].startswith('/'):
            opts['state_top'] = salt.utils.url.create(opts['state_top'][1:])
        else:
            opts['state_top'] = salt.utils.url.create(opts['state_top'])
        if self.ext and self.__valid_on_demand_ext_pillar(opts):
            if 'ext_pillar' in opts:
                opts['ext_pillar'].append(self.ext)
            else:
                opts['ext_pillar'] = [self.ext]
        if '__env__' in opts['pillar_roots']:
            env = opts.get('pillarenv') or opts.get('saltenv') or 'base'
            if env not in opts['pillar_roots']:
                log.debug("pillar environment '%s' maps to __env__ pillar_roots directory", env)
                opts['pillar_roots'][env] = opts['pillar_roots'].pop('__env__')
            else:
                log.debug("pillar_roots __env__ ignored (environment '%s' found in pillar_roots)",
                          env)
                opts['pillar_roots'].pop('__env__')
        return opts
def __gen_opts ( self , opts_in , grains , saltenv = None , ext = None , pillarenv = None ) : opts = copy . deepcopy ( opts_in ) opts [ 'file_client' ] = 'local' if not grains : opts [ 'grains' ] = { } else : opts [ 'grains' ] = grains opts [ 'saltenv' ] = saltenv if saltenv is not None else opts . get ( 'saltenv' ) opts [ 'pillarenv' ] = pillarenv if pillarenv is not None else opts . get ( 'pillarenv' ) opts [ 'id' ] = self . minion_id if opts [ 'state_top' ] . startswith ( 'salt://' ) : opts [ 'state_top' ] = opts [ 'state_top' ] elif opts [ 'state_top' ] . startswith ( '/' ) : opts [ 'state_top' ] = salt . utils . url . create ( opts [ 'state_top' ] [ 1 : ] ) else : opts [ 'state_top' ] = salt . utils . url . create ( opts [ 'state_top' ] ) if self . ext and self . __valid_on_demand_ext_pillar ( opts ) : if 'ext_pillar' in opts : opts [ 'ext_pillar' ] . append ( self . ext ) else : opts [ 'ext_pillar' ] = [ self . ext ] if '__env__' in opts [ 'pillar_roots' ] : env = opts . get ( 'pillarenv' ) or opts . get ( 'saltenv' ) or 'base' if env not in opts [ 'pillar_roots' ] : log . debug ( "pillar environment '%s' maps to __env__ pillar_roots directory" , env ) opts [ 'pillar_roots' ] [ env ] = opts [ 'pillar_roots' ] . pop ( '__env__' ) else : log . debug ( "pillar_roots __env__ ignored (environment '%s' found in pillar_roots)" , env ) opts [ 'pillar_roots' ] . pop ( '__env__' ) return opts
The options need to be altered to conform to the file client