Better output of job status
This commit is contained in:
parent
aa2bb7c94c
commit
089b3d7a43
|
@ -636,18 +636,25 @@ def task_status(config, task_id):
|
||||||
retvalue = True
|
retvalue = True
|
||||||
respjson = response.json()
|
respjson = response.json()
|
||||||
job_state = respjson['state']
|
job_state = respjson['state']
|
||||||
if job_state == 'PENDING':
|
|
||||||
retdata = 'Job state: PENDING'
|
|
||||||
if job_state == 'RUNNING':
|
if job_state == 'RUNNING':
|
||||||
retdata = 'Job state: RUNNING\nStage: {}/{}\nStatus: {}'.format(
|
retdata = 'Job state: RUNNING\nStage: {}/{}\nStatus: {}'.format(
|
||||||
respjson['current'],
|
respjson['current'],
|
||||||
respjson['total'],
|
respjson['total'],
|
||||||
respjson['status']
|
respjson['status']
|
||||||
)
|
)
|
||||||
if job_state == 'FAILED':
|
elif job_state == 'FAILED':
|
||||||
retdata = 'Job state: FAILED\nStatus: {}'.format(
|
retdata = 'Job state: FAILED\nStatus: {}'.format(
|
||||||
respjson['status']
|
respjson['status']
|
||||||
)
|
)
|
||||||
|
elif job_state == 'COMPLETED':
|
||||||
|
retdata = 'Job state: COMPLETED\nStatus: {}'.format(
|
||||||
|
respjson['status']
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
retdata = 'Job state: {}\nStatus: {}'.format(
|
||||||
|
respjson['state'],
|
||||||
|
respjson['status']
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
retvalue = False
|
retvalue = False
|
||||||
retdata = response.json()['message']
|
retdata = response.json()['message']
|
||||||
|
|
Loading…
Reference in New Issue