add job_description to failed workflow node

* When workflow job fails because a workflow job node doesn't have a
related unified_job_template note that with an error on the workflow
job's job_description
* When a workflow job fails because a failure path isn't defined, note
that on the workflow job job_description
This commit is contained in:
chris meyers
2018-11-16 14:45:12 -05:00
committed by mabashian
parent 00d71cea50
commit 676c068b71
4 changed files with 21 additions and 14 deletions

View File

@@ -178,14 +178,18 @@ class TaskManager():
is_done = dag.is_workflow_done()
if not is_done:
continue
has_failed = dag.has_workflow_failed()
has_failed, reason = dag.has_workflow_failed()
logger.info('Marking %s as %s.', workflow_job.log_format, 'failed' if has_failed else 'successful')
result.append(workflow_job.id)
new_status = 'failed' if has_failed else 'successful'
logger.debug(six.text_type("Transitioning {} to {} status.").format(workflow_job.log_format, new_status))
update_fields = ['status', 'start_args']
workflow_job.status = new_status
if reason:
workflow_job.job_explanation = reason
update_fields.append('job_explanation')
workflow_job.start_args = '' # blank field to remove encrypted passwords
workflow_job.save(update_fields=['status', 'start_args'])
workflow_job.save(update_fields=update_fields)
status_changed = True
if status_changed:
workflow_job.websocket_emit_status(workflow_job.status)