mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 16:51:31 +00:00
Add event logging to FSMAware
This commit is contained in:
parent
199e1a5d6e
commit
d94bc37d48
@ -16,7 +16,7 @@ class FSMAware:
|
||||
def __init__(self):
|
||||
self.fsm_state = None
|
||||
self.fsm_in_accepted_state = False
|
||||
self.fsm_last_update = None
|
||||
self.fsm_event_log = []
|
||||
self._auth_key = KeyManager().auth_key
|
||||
|
||||
def update_fsm_data(self, message):
|
||||
@ -27,12 +27,13 @@ class FSMAware:
|
||||
|
||||
def _handle_fsm_update(self, message):
|
||||
try:
|
||||
new_state = message['data']['current_state']
|
||||
update_data = message['data']
|
||||
new_state = update_data['current_state']
|
||||
if self.fsm_state != new_state:
|
||||
self.handle_fsm_step(**(message['data']))
|
||||
self.handle_fsm_step(**update_data)
|
||||
self.fsm_state = new_state
|
||||
self.fsm_in_accepted_state = message['data']['in_accepted_state']
|
||||
self.fsm_last_update = message['data']
|
||||
self.fsm_in_accepted_state = update_data['in_accepted_state']
|
||||
self.fsm_event_log.append(update_data)
|
||||
except KeyError:
|
||||
LOG.error('Invalid fsm_update message received!')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user