From 8b8778399825f54705efc11994d9605bf8ee33b3 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 21 Sep 2022 16:07:00 +0530 Subject: [PATCH] Island: Subscribe set_island_mode to IslandEventTopic.SET_MODE --- monkey/monkey_island/cc/setup/island_event_handlers.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/monkey/monkey_island/cc/setup/island_event_handlers.py b/monkey/monkey_island/cc/setup/island_event_handlers.py index a69cf1731..274399eb2 100644 --- a/monkey/monkey_island/cc/setup/island_event_handlers.py +++ b/monkey/monkey_island/cc/setup/island_event_handlers.py @@ -5,6 +5,7 @@ from monkey_island.cc.event_queue import IIslandEventQueue, IslandEventTopic from monkey_island.cc.island_event_handlers import ( reset_agent_configuration, reset_machine_repository, + set_island_mode, ) from monkey_island.cc.repository import ( IAgentEventRepository, @@ -20,6 +21,7 @@ def setup_island_event_handlers(container: DIContainer): _subscribe_reset_agent_configuration_events(island_event_queue, container) _subscribe_clear_simulation_data_events(island_event_queue, container) + _subscribe_set_island_mode_events(island_event_queue, container) def _subscribe_reset_agent_configuration_events( @@ -52,3 +54,9 @@ def _subscribe_clear_simulation_data_events( ]: repository = container.resolve(i_repository) island_event_queue.subscribe(IslandEventTopic.CLEAR_SIMULATION_DATA, repository.reset) + + +def _subscribe_set_island_mode_events( + island_event_queue: IIslandEventQueue, container: DIContainer +): + island_event_queue.subscribe(IslandEventTopic.SET_MODE, container.resolve(set_island_mode))