#NEWLINE# def _get_cached_minion_data( self , * minion_ids ) : #NEWLINE# #INDENT# grains = dict ( [ ( minion_id , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) for minion_id in minion_ids ] ) #NEWLINE# pillars = grains . copy ( ) #NEWLINE# if ( not self . opts . get ( 'minion_data_cache' , False ) ) : #NEWLINE# #INDENT# log . debug ( 'Skipping cached data because minion_data_cache is not enabled.' ) #NEWLINE# return ( grains , pillars ) #NEWLINE# #UNINDENT# mdir = os . path . join ( self . opts [ 'cachedir' ] , 'minions' ) #NEWLINE# try : #NEWLINE# #INDENT# for minion_id in minion_id : #NEWLINE# #INDENT# if ( not salt . utils . verify . valid_id ( self . opts , minion_id ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# path = os . path . join ( mdir , minion_id , 'data.p' ) #NEWLINE# if os . path . isfile ( path ) : #NEWLINE# #INDENT# with salt . utils . fopen ( path , 'rb' ) as fp_ : #NEWLINE# #INDENT# mdata = self . serial . loads ( fp_ . read ( ) ) #NEWLINE# if mdata . get ( 'grains' , False ) : #NEWLINE# #INDENT# grains [ minion_id ] = mdata [ 'grains' ] #NEWLINE# #UNINDENT# if mdata . get ( 'pillar' , False ) : #NEWLINE# #INDENT# pillars [ minion_id ] = mdata [ 'pillar' ] #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# except ( OSError , IOError ) : #NEWLINE# #INDENT# return ( grains , pillars ) #NEWLINE# #UNINDENT# return ( grains , pillars )