Merge pull request #40665 from rallytime/bp-35665

Back-port #35665 to 2016.11
This commit is contained in:
Mike Place 2017-04-12 15:06:36 -06:00 committed by GitHub
commit 6df76f6687

View File

@ -1319,29 +1319,28 @@ class Jobs(LowDataAdapter):
'''
lowstate = [{
'client': 'runner',
'fun': 'jobs.lookup_jid' if jid else 'jobs.list_jobs',
'fun': 'jobs.list_job' if jid else 'jobs.list_jobs',
'jid': jid,
}]
if jid:
lowstate.append({
'client': 'runner',
'fun': 'jobs.list_job',
'jid': jid,
})
cherrypy.request.lowstate = lowstate
job_ret_info = list(self.exec_lowstate(
token=cherrypy.session.get('token')))
ret = {}
if jid:
job_ret, job_info = job_ret_info
ret['info'] = [job_info]
ret['info'] = [job_ret_info[0]]
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:
job_ret = job_ret_info[0]
ret['return'] = [job_ret_info[0]]
ret['return'] = [job_ret]
return ret