mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Switch from comprehension to logic used in jobs runner. This makes it
easier to deal with potential unicode in returns.
This commit is contained in:
parent
78dd629f09
commit
0f897b2426
@ -1330,10 +1330,14 @@ class Jobs(LowDataAdapter):
|
||||
ret = {}
|
||||
if jid:
|
||||
ret['info'] = [job_ret_info[0]]
|
||||
try:
|
||||
ret['return'] = [dict((k, job_ret_info[0]['Result'][k]['return']) for k in job_ret_info[0]['Result'])]
|
||||
except (TypeError, KeyError):
|
||||
ret['return'] = [{}]
|
||||
minion_ret = {}
|
||||
returns = job_ret_info[0].get('Result')
|
||||
for minion in returns.keys():
|
||||
if u'return' in returns[minion]:
|
||||
minion_ret[minion] = returns[minion].get(u'return')
|
||||
else:
|
||||
minion_ret[minion] = returns[minion].get('return')
|
||||
ret['return'] = [minion_ret]
|
||||
else:
|
||||
ret['return'] = [job_ret_info[0]]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user