Merge "Leave the execution_graph as none until compiled"
This commit is contained in:
@@ -77,8 +77,14 @@ class ActionEngine(base.EngineBase):
|
||||
|
||||
@property
|
||||
def execution_graph(self):
|
||||
self.compile()
|
||||
return self._analyzer.execution_graph
|
||||
"""The graph of nodes to be executed.
|
||||
|
||||
NOTE(harlowja): Only accessible after compilation has completed.
|
||||
"""
|
||||
g = None
|
||||
if self._compiled and self._analyzer:
|
||||
g = self._analyzer.execution_graph
|
||||
return g
|
||||
|
||||
@lock_utils.locked
|
||||
def run(self):
|
||||
|
||||
@@ -464,6 +464,7 @@ class EngineGraphFlowTest(utils.EngineTestBase):
|
||||
utils.TaskNoRequiresNoReturns(name='task2'))
|
||||
|
||||
engine = self._make_engine(flow)
|
||||
engine.compile()
|
||||
graph = engine.execution_graph
|
||||
self.assertIsInstance(graph, networkx.DiGraph)
|
||||
|
||||
@@ -471,6 +472,7 @@ class EngineGraphFlowTest(utils.EngineTestBase):
|
||||
flow = utils.TaskNoRequiresNoReturns(name='task1')
|
||||
|
||||
engine = self._make_engine(flow)
|
||||
engine.compile()
|
||||
graph = engine.execution_graph
|
||||
self.assertIsInstance(graph, networkx.DiGraph)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user