diff --git a/lib/tfw/networking/fsm_aware.py b/lib/tfw/networking/fsm_aware.py index e666d8c..cb2b287 100644 --- a/lib/tfw/networking/fsm_aware.py +++ b/lib/tfw/networking/fsm_aware.py @@ -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!')