From e9433ad23ba2b5f13b7ce95b2335444cc47e6d41 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 20 Sep 2022 10:05:47 -0400 Subject: [PATCH] Agent: Initialize _agent_event_serializer_registry in __init__() --- monkey/infection_monkey/monkey.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index ba63d87cb..ab3461c73 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -107,9 +107,12 @@ logging.getLogger("urllib3").setLevel(logging.INFO) class InfectionMonkey: def __init__(self, args): logger.info("Monkey is initializing...") + self._singleton = SystemSingleton() self._opts = self._get_arguments(args) + self._agent_event_serializer_registry = self._setup_agent_event_serializers() + # TODO: Revisit variable names server, island_api_client = self._connect_to_island_api() # TODO: `address_to_port()` should return the port as an integer. @@ -207,8 +210,6 @@ class InfectionMonkey: if firewall.is_enabled(): firewall.add_firewall_rule() - self._agent_event_serializer_registry = self._setup_agent_event_serializers() - self._control_channel = ControlChannel(self._control_client.server_address, GUID) self._control_channel.register_agent(self._opts.parent)