#NEWLINE# def get_minion_grains( self ) : #NEWLINE# #INDENT# '\n        Get grains data for the targeted minions, either by fetching the\n        cached minion data on the master, or by fetching the grains\n        directly on the minion.\n\n        By default, this function tries hard to get the pillar data:\n            - Try to get the cached minion grains if the master\n                has minion_data_cache: True\n            - If the grains data for the minion is cached, use it.\n            - If there is no cached grains data for a minion,\n                then try to get the minion grains directly from the minion.\n        ' #NEWLINE# minion_grains = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# minion_ids = self . _tgt_to_list ( ) #NEWLINE# if any ( ( self for arg in [ self . use_cached_grains , self . grains_fallback ] ) ) : #NEWLINE# #INDENT# log . debug ( 'Getting cached minion data.' ) #NEWLINE# ( cached_minion_grains , cached_minion_pillars ) = self . _get_cached_minion_data ( * minion_ids ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cached_minion_grains = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# log . debug ( 'Getting minion grain data for: {0}' . format ( minion_ids ) ) #NEWLINE# minion_grains = self . _get_minion_grains ( * minion_ids , cached_grains = cached_minion_grains ) #NEWLINE# return minion_grains