From 547637d151e13c4d8f78a0e2da83584793a42f1b Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 21 Sep 2022 18:02:07 +0530 Subject: [PATCH] Island: Subscribe ISimulationRepository.set_mode to IslandEventTopic.SET_ISLAND_MODE --- monkey/monkey_island/cc/island_event_handlers/__init__.py | 1 - monkey/monkey_island/cc/setup/island_event_handlers.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/island_event_handlers/__init__.py b/monkey/monkey_island/cc/island_event_handlers/__init__.py index 0f111a31e..11343c2fa 100644 --- a/monkey/monkey_island/cc/island_event_handlers/__init__.py +++ b/monkey/monkey_island/cc/island_event_handlers/__init__.py @@ -1,4 +1,3 @@ from .reset_agent_configuration import reset_agent_configuration from .reset_machine_repository import reset_machine_repository from .set_agent_configuration_per_island_mode import set_agent_configuration_per_island_mode -from .set_simulation_mode import set_simulation_mode diff --git a/monkey/monkey_island/cc/setup/island_event_handlers.py b/monkey/monkey_island/cc/setup/island_event_handlers.py index 46429f292..ee37568f1 100644 --- a/monkey/monkey_island/cc/setup/island_event_handlers.py +++ b/monkey/monkey_island/cc/setup/island_event_handlers.py @@ -6,13 +6,13 @@ from monkey_island.cc.island_event_handlers import ( reset_agent_configuration, reset_machine_repository, set_agent_configuration_per_island_mode, - set_simulation_mode, ) from monkey_island.cc.repository import ( IAgentEventRepository, IAgentRepository, ICredentialsRepository, INodeRepository, + ISimulationRepository, ) from monkey_island.cc.services.database import Database @@ -62,4 +62,5 @@ def _subscribe_set_island_mode_events( island_event_queue.subscribe(topic, container.resolve(set_agent_configuration_per_island_mode)) - island_event_queue.subscribe(topic, container.resolve(set_simulation_mode)) + simulation_repository = container.resolve(ISimulationRepository) + island_event_queue.subscribe(topic, simulation_repository.set_mode)