Island: Wrap island event handler setup in separate function

This commit is contained in:
Mike Salvatore 2022-09-12 13:46:45 -04:00 committed by Ilija Lazoroski
parent 7f29e0342d
commit 745027bf93
1 changed files with 6 additions and 0 deletions

View File

@ -6,6 +6,12 @@ from monkey_island.cc.island_event_handlers import reset_agent_configuration
def setup_island_event_handlers(container: DIContainer): def setup_island_event_handlers(container: DIContainer):
event_queue = container.resolve(IIslandEventQueue) event_queue = container.resolve(IIslandEventQueue)
_handle_reset_agent_configuration_events(event_queue, container)
def _handle_reset_agent_configuration_events(
event_queue: IIslandEventQueue, container: DIContainer
):
event_queue.subscribe( event_queue.subscribe(
IslandEventTopic.RESET_AGENT_CONFIGURATION, container.resolve(reset_agent_configuration) IslandEventTopic.RESET_AGENT_CONFIGURATION, container.resolve(reset_agent_configuration)
) )