Use flow_uuid and flow_name from storage
Instead of fetching these attributes from the flow or flow detail objects before notifying just use the same attributes provided from storage which is the best source of these two attributes. Change-Id: I383e152758f177de2aac87425790ee1a82c3ca6b
This commit is contained in:
@@ -144,20 +144,12 @@ class ActionEngine(base.EngineBase):
|
||||
if not states.check_flow_transition(old_state, state):
|
||||
return
|
||||
self.storage.set_flow_state(state)
|
||||
try:
|
||||
flow_uuid = self._flow.uuid
|
||||
except AttributeError:
|
||||
# NOTE(harlowja): if the flow was just a single task, then it
|
||||
# will not itself have a uuid, but the constructed flow_detail
|
||||
# will.
|
||||
if self._flow_detail is not None:
|
||||
flow_uuid = self._flow_detail.uuid
|
||||
else:
|
||||
flow_uuid = None
|
||||
details = dict(engine=self,
|
||||
flow_name=self._flow.name,
|
||||
flow_uuid=flow_uuid,
|
||||
old_state=old_state)
|
||||
details = {
|
||||
'engine': self,
|
||||
'flow_name': self.storage.flow_name,
|
||||
'flow_uuid': self.storage.flow_uuid,
|
||||
'old_state': old_state,
|
||||
}
|
||||
self.notifier.notify(state, details)
|
||||
|
||||
def _ensure_storage(self):
|
||||
|
||||
Reference in New Issue
Block a user