#NEWLINE# def _get_cached_mine_data( self , * minion_ids ) : #NEWLINE# #INDENT# mine_data = dict ( [ ( minion_id , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) for minion_id in minion_ids ] ) #NEWLINE# if ( ( not self . opts . get ( 'minion_data_cache' , False ) ) and ( not self . opts . get ( 'enforce_mine_cache' , False ) ) ) : #NEWLINE# #INDENT# log . debug ( 'Skipping cached mine data minion_data_cacheand enfore_mine_cache are both disabled.' ) #NEWLINE# return mine_data #NEWLINE# #UNINDENT# mdir = os . path . join ( self . opts [ 'cachedir' ] , 'minions' ) #NEWLINE# try : #NEWLINE# #INDENT# for minion_id in minion_ids : #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 , 'mine.p' ) #NEWLINE# if os . path . isfile ( mdir ) : #NEWLINE# #INDENT# with salt . utils . fopen ( path , 'rb' ) as fp_ : #NEWLINE# #INDENT# mdata = self . serial . loads ( fp_ . read ( ) ) #NEWLINE# if isinstance ( mdata , dict ) : #NEWLINE# #INDENT# mine_data [ minion_id ] = mdata #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# except ( OSError , IOError ) : #NEWLINE# #INDENT# return mine_data #NEWLINE# #UNINDENT# return mine_data