def pillar(pool, tgt, opts=None): ''' ''' delimiter = opts.get('delimiter', DEFAULT_TARGET_DELIM) log.debug('Pillar matching on %s, over %s', tgt, pool) ret = { minion: pool[minion] for minion in pool.keys() if subdict_match( pool[minion].get('minion_opts', {}).get('pillar', {}), tgt, delimiter=delimiter, ) } log.debug('Pillar match returned') log.debug(ret) return ret
def grain_pcre(pool, tgt, opts=None): ''' ''' delimiter = opts.get('delimiter', DEFAULT_TARGET_DELIM) log.debug('Grain PCRE matching on %s, over %s', tgt, pool) ret = { minion: pool[minion] for minion in pool.keys() if subdict_match( pool[minion].get('minion_opts', {}).get('grains', {}), tgt, delimiter=delimiter, regex_match=True, ) } log.debug('Grain PCRE match returned') log.debug(ret) return ret