Just make the compiler object at __init__ time

There really isn't any benefit in delaying the local
attributes creation until its first used so just upfront
create the compiler object.

Change-Id: I48c4342a6669077dd35f9cb8f25b5313d6814c8e
This commit is contained in:
Joshua Harlow
2015-06-28 20:54:31 -07:00
parent b8dab64a8c
commit 109b5984b1

View File

@@ -64,7 +64,6 @@ class ActionEngine(base.Engine):
valid states in the states module to learn more about what other states
the tasks and flow being ran can go through.
"""
_compiler_factory = compiler.PatternCompiler
NO_RERAISING_STATES = frozenset([states.SUSPENDED, states.SUCCESS])
"""
@@ -78,6 +77,7 @@ class ActionEngine(base.Engine):
self._runtime = None
self._compiled = False
self._compilation = None
self._compiler = compiler.PatternCompiler(flow)
self._lock = threading.RLock()
self._state_lock = threading.RLock()
self._storage_ensured = False
@@ -282,10 +282,6 @@ class ActionEngine(base.Engine):
self._runtime.reset_all()
self._change_state(states.PENDING)
@misc.cachedproperty
def _compiler(self):
return self._compiler_factory(self._flow)
@fasteners.locked
def compile(self):
if self._compiled: