mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
commit
dcae209951
@ -70,9 +70,10 @@ 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
|
||||
|
||||
@ -133,15 +134,16 @@ def lookup_jid(jid,
|
||||
targeted_minions = data.get('Minions', [])
|
||||
returns = data.get('Result', {})
|
||||
|
||||
for minion in returns:
|
||||
if display_progress:
|
||||
__jid_event__.fire_event({'message': minion}, 'progress')
|
||||
if u'return' in returns[minion]:
|
||||
if returned:
|
||||
ret[minion] = returns[minion].get(u'return')
|
||||
else:
|
||||
if returned:
|
||||
ret[minion] = returns[minion].get('return')
|
||||
if returns:
|
||||
for minion in returns:
|
||||
if display_progress:
|
||||
__jid_event__.fire_event({'message': minion}, 'progress')
|
||||
if u'return' in returns[minion]:
|
||||
if returned:
|
||||
ret[minion] = returns[minion].get(u'return')
|
||||
else:
|
||||
if returned:
|
||||
ret[minion] = returns[minion].get('return')
|
||||
if missing:
|
||||
for minion_id in (x for x in targeted_minions if x not in returns):
|
||||
ret[minion_id] = 'Minion did not return'
|
||||
@ -541,6 +543,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
|
||||
|
Loading…
Reference in New Issue
Block a user