#NEWLINE# def _get_minion_grains( self , * minion_ids , **kwargs ) : #NEWLINE# #INDENT# ret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# cached_grains = kwargs . get ( 'cached_grains' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# cret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# lret = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if self . use_cached_grains : #NEWLINE# #INDENT# cret = dict ( [ ( minion_id , mcache ) for ( minion_id , mcache ) in six . iteritems ( cached_grains ) if mcache ] ) #NEWLINE# missed_minions = [ minion_id for minion_id in minion_ids if ( minion_id not in cret ) ] #NEWLINE# log . debug ( 'Missed cached minion grains for: {0}' . format ( missed_minions ) ) #NEWLINE# if self . grains_fallback : #NEWLINE# #INDENT# lret = self . _get_live_minion_grains ( missed_minions ) #NEWLINE# #UNINDENT# ret = dict ( ( ( list ( six . iteritems ( dict ( [ ( minion_id , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) for minion_id in minion_ids ] ) ) ) + list ( lret . items ( ) ) ) + list ( cret . items ( ) ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# lret = self . _get_live_minion_grains ( minion_ids ) #NEWLINE# missed_minions = [ minion_id for minion_id in minion_ids if ( minion_id not in lret ) ] #NEWLINE# log . debug ( 'Missed live minion grains for: {0}' . format ( missed_minions ) ) #NEWLINE# if self . grains_fallback : #NEWLINE# #INDENT# cret = dict ( [ ( minion_id , mcache ) for ( minion_id , mcache ) in six . iteritems ( cached_grains ) if mcache ] ) #NEWLINE# #UNINDENT# ret = dict ( ( ( list ( six . iteritems ( dict ( [ ( minion_id , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) for minion_id in minion_ids ] ) ) ) + list ( lret . items ( ) ) ) + list ( cret . items ( ) ) ) ) #NEWLINE# #UNINDENT# return ret