mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #27776 from jfindlay/local_msg
return message when local jobs_cache not found
This commit is contained in:
commit
18e31584b0
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user