Minor organization clarity for workflow failure summary

This commit is contained in:
Alan Rominger 2021-01-05 10:33:35 -05:00
parent 9a16e9f787
commit d3c51ce75d
No known key found for this signature in database
GPG Key ID: C2D7EAAA12B63559

View File

@ -17,9 +17,9 @@ class WorkflowJob(UnifiedJob):
"""Special implementation of this part of assert_status so that
workflow_job.assert_successful() will give a breakdown of failure
"""
msg = '\nNode summary:'
node_list = self.related.workflow_nodes.get().results
msg = '\nNode summary:'
for node in node_list:
msg += '\n{}: {}'.format(node.id, node.summary_fields.get('job'))
for rel in ('failure_nodes', 'always_nodes', 'success_nodes'):
@ -29,12 +29,14 @@ class WorkflowJob(UnifiedJob):
msg += '\n\nUnhandled individual job failures:\n'
for node in node_list:
# nodes without always or failure paths consider failures unhandled
if node.job and not (node.failure_nodes or node.always_nodes):
job = node.related.job.get()
try:
job.assert_successful()
except Exception as e:
msg += str(e)
return msg
@property