return message when local jobs_cache not found

Fixes #27735.
This commit is contained in:
Justin Findlay 2015-10-07 16:44:39 -06:00
parent b2937b6a16
commit 03afa3cffa

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()