From 14592d964e8efc132064ee932a36566ba13fed11 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Tue, 20 Sep 2022 12:52:36 +0200 Subject: [PATCH] Agent: Pass island_api_client when constructing AgentEventForwarder --- monkey/infection_monkey/monkey.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 96da82225..ba63d87cb 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -248,7 +248,7 @@ class InfectionMonkey: ) event_queue = PyPubSubAgentEventQueue(Publisher()) - InfectionMonkey._subscribe_events( + self._subscribe_events( event_queue, propagation_credentials_repository, self._control_client.server_address, @@ -274,8 +274,8 @@ class InfectionMonkey: propagation_credentials_repository, ) - @staticmethod def _subscribe_events( + self, event_queue: IAgentEventQueue, propagation_credentials_repository: IPropagationCredentialsRepository, server_address: str, @@ -288,7 +288,7 @@ class InfectionMonkey: ), ) event_queue.subscribe_all_events( - AgentEventForwarder(server_address, agent_event_serializer_registry).send_event + AgentEventForwarder(self.island_api_client, agent_event_serializer_registry).send_event ) def _build_puppet(