Merge pull request #27776 from jfindlay/local_msg

return message when local jobs_cache not found
This commit is contained in:
Mike Place 2015-10-12 10:11:41 -06:00
commit 18e31584b0

View File

@ -577,7 +577,11 @@ def find_cached_job(jid):
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):
return
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()