mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 22:51:32 +00:00
Refactor FSM triggering in TFWServer
This commit is contained in:
parent
ba66188d80
commit
87fa86d314
@ -38,13 +38,16 @@ class TFWServer:
|
|||||||
return self._fsm_manager
|
return self._fsm_manager
|
||||||
|
|
||||||
def make_response(self, message):
|
def make_response(self, message):
|
||||||
|
self.trigger_fsm(message)
|
||||||
|
message['FSMUpdate'] = self._fsm_updater.get_fsm_state_and_transitions()
|
||||||
|
return message
|
||||||
|
|
||||||
|
def trigger_fsm(self, message):
|
||||||
trigger = message.get('trigger', '')
|
trigger = message.get('trigger', '')
|
||||||
try:
|
try:
|
||||||
self._fsm_manager.trigger(trigger, message)
|
self._fsm_manager.trigger(trigger, message)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
LOG.debug('FSM failed to execute nonexistent trigger: "%s"', trigger)
|
LOG.debug('FSM failed to execute nonexistent trigger: "%s"', trigger)
|
||||||
message['FSMUpdate'] = self._fsm_updater.get_fsm_state_and_transitions()
|
|
||||||
return message
|
|
||||||
|
|
||||||
def proxy_filter(self, message):
|
def proxy_filter(self, message):
|
||||||
# pylint: disable=unused-argument,no-self-use
|
# pylint: disable=unused-argument,no-self-use
|
||||||
|
Loading…
Reference in New Issue
Block a user