def get_minion_data(minion, opts):
 grains = None
 pillar = None
 if opts.get('minion_data_cache', False):
  cache = salt.cache.Cache(opts)
  if (minion is None):
   for id_ in cache.list('minions'):
    data = cache.fetch('minions/{0}'.format(id_), 'data')
    if (data is None):
     continue
  else:
   data = cache.fetch('minions/{0}'.format(minion), 'data')
  if (data is not None):
   grains = data['grains']
   pillar = data['pillar']
 return ((minion if minion else None), grains, pillar)

def get_minion_data ( minion , opts ) : grains = None pillar = None if opts . get ( 'minion_data_cache' , False ) : cache = salt . cache . Cache ( opts ) if ( minion is None ) : for id_ in cache . list ( 'minions' ) : data = cache . fetch ( 'minions/{0}' . format ( id_ ) , 'data' ) if ( data is None ) : continue else : data = cache . fetch ( 'minions/{0}' . format ( minion ) , 'data' ) if ( data is not None ) : grains = data [ 'grains' ] pillar = data [ 'pillar' ] return ( ( minion if minion else None ) , grains , pillar )
get the grains/pillar for a specific minion .