Catch two cases when a returner is not able to be contacted--these would throw a stacktrace.

This commit is contained in:
C. R. Oldham 2018-06-06 21:07:00 -06:00
parent 1ce7d6c38a
commit 5abeedf882
No known key found for this signature in database
GPG key ID: EAFC861C05EB599D

View file

@ -70,13 +70,13 @@ def active(display_progress=False):
for jid in ret:
returner = _get_returner((__opts__['ext_job_cache'], __opts__['master_job_cache']))
data = mminion.returners['{0}.get_jid'.format(returner)](jid)
for minion in data:
if minion not in ret[jid]['Returned']:
ret[jid]['Returned'].append(minion)
if data:
for minion in data:
if minion not in ret[jid]['Returned']:
ret[jid]['Returned'].append(minion)
return ret
def lookup_jid(jid,
ext_source=None,
returned=True,
@ -541,6 +541,10 @@ def _format_job_instance(job):
'''
Helper to format a job instance
'''
if not job:
ret = {'Error': 'Cannot contact returner or no job with this jid'}
return ret
ret = {'Function': job.get('fun', 'unknown-function'),
'Arguments': list(job.get('arg', [])),
# unlikely but safeguard from invalid returns