def find_cached_job(jid):
 serial = salt.payload.Serial(__opts__)
 proc_dir = os.path.join(__opts__['cachedir'], 'minion_jobs')
 job_dir = os.path.join(proc_dir, str(jid))
 if (not os.path.isdir(job_dir)):
  if (not __opts__.get('cache_jobs')):
   return 'Local jobs cache directory not found; you may need to enable cache_jobs on this minion'
  else:
   return 'Local jobs cache directory {0} not found'.format(job_dir)
 path = os.path.join(job_dir, 'return.p')
 with salt.utils.fopen(path, 'rb') as fp_:
  buf = fp_.read()
  fp_.close()
  if buf:
   try:
    data = serial.loads(buf)
   except NameError:
    return
  else:
   return
 if (not isinstance(data, dict)):
  return
 return data

def find_cached_job ( jid ) : serial = salt . payload . Serial ( __opts__ ) proc_dir = os . path . join ( __opts__ [ 'cachedir' ] , 'minion_jobs' ) job_dir = os . path . join ( proc_dir , str ( jid ) ) if ( not os . path . isdir ( job_dir ) ) : if ( not __opts__ . get ( 'cache_jobs' ) ) : return 'Local jobs cache directory not found; you may need to enable cache_jobs on this minion' else : return 'Local jobs cache directory {0} not found' . format ( job_dir ) path = os . path . join ( job_dir , 'return.p' ) with salt . utils . fopen ( path , 'rb' ) as fp_ : buf = fp_ . read ( ) fp_ . close ( ) if buf : try : data = serial . loads ( buf ) except NameError : return else : return if ( not isinstance ( data , dict ) ) : return return data
return the data for a specific cached job id .