From 70cf4cf5d424ca994ddd1ab8cc5bb1aaa117b922 Mon Sep 17 00:00:00 2001 From: Rebeccah Date: Mon, 13 Jan 2020 13:53:07 -0500 Subject: [PATCH] added in handling for a parent being DNR so status is only checked if the parent isn't a DNR parent (in which case the parent has no status, which was breaking the logic) also edited a comment and added in a DNR check that @alancoding suggested to cut out duplicates in the DAG list --- awx/main/scheduler/dag_workflow.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/awx/main/scheduler/dag_workflow.py b/awx/main/scheduler/dag_workflow.py index 25e94b0a73..4777d68948 100644 --- a/awx/main/scheduler/dag_workflow.py +++ b/awx/main/scheduler/dag_workflow.py @@ -219,13 +219,14 @@ class WorkflowDAG(SimpleDAG): if self._should_mark_node_dnr(node, parent_nodes): obj.do_not_run = True nodes_marked_do_not_run.append(node) - if obj.all_parents_must_converge: + if not obj.do_not_run and obj.all_parents_must_converge: if self._are_relevant_parents_finished(node): # if the current node is a convergence node and all the # parents are finished then check to see if all parents - # met their success criteria to run the convergence child + # met the needed criteria to run the convergence child + # (i.e. parent must fail, parent must succeed) parent_nodes = [p['node_object'] for p in self.get_parents(obj)] - if not all(obj in self.get_children(p, p.job.status) for p in parent_nodes): + if any(p.do_not_run for p in parent_nodes) or not all(obj in self.get_children(p, p.job.status)for p in parent_nodes): obj.do_not_run = True nodes_marked_do_not_run.append(node)