From 82dd4a38841766d9534110e5446c46398ebc3757 Mon Sep 17 00:00:00 2001 From: Rebeccah Date: Tue, 21 Jan 2020 16:15:01 -0500 Subject: [PATCH] remove node_object comparison and use the full dict to eliminate issues comparing obj and compare instead the whole node object with the node objects in the list --- awx/main/scheduler/dag_workflow.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/awx/main/scheduler/dag_workflow.py b/awx/main/scheduler/dag_workflow.py index b50c6fa96b..e7eaa5411e 100644 --- a/awx/main/scheduler/dag_workflow.py +++ b/awx/main/scheduler/dag_workflow.py @@ -228,15 +228,18 @@ class WorkflowDAG(SimpleDAG): obj.do_not_run = True nodes_marked_do_not_run.append(node) else: + # import sdb + # sdb.set_trace() for p in parent_nodes: + child_nodes = [] if p.job.status == "successful": - child_nodes = (c['node_object'] for c in self.get_children(p, "success_nodes")) - elif p.job.status == "failure": - child_nodes = (c['node_object'] for c in self.get_children(p, "failure_nodes")) - else: - child_nodes = (c['node_object'] for c in self.get_children(p, "always_nodes")) - if not any(obj == x for x in child_nodes): + child_nodes = [x for x in self.get_children(p, "success_nodes")] + elif p.job.status == "failed": + child_nodes = [x for x in self.get_children(p, "failure_nodes")] + child_nodes.extend(x for x in self.get_children(p, "always_nodes")) + if node not in child_nodes: obj.do_not_run = True - nodes_marked_do_not_run.append(node) + nodes_marked_do_not_run.append(node) + break return [n['node_object'] for n in nodes_marked_do_not_run]