diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 4b235133c..98e2b46a5 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -258,11 +258,6 @@ class InfectionMonkey: return agent_event_serializer_registry - def _build_server_list(self, relay_port: int) -> Sequence[str]: - my_servers = set(map(str, self._opts.servers)) - relay_servers = {f"{ip}:{relay_port}" for ip in get_my_ip_addresses()} - return list(my_servers.union(relay_servers)) - def _build_master(self, relay_port: int): servers = self._build_server_list(relay_port) local_network_interfaces = get_network_interfaces() @@ -298,6 +293,11 @@ class InfectionMonkey: propagation_credentials_repository, ) + def _build_server_list(self, relay_port: int) -> Sequence[str]: + my_servers = set(map(str, self._opts.servers)) + relay_servers = {f"{ip}:{relay_port}" for ip in get_my_ip_addresses()} + return list(my_servers.union(relay_servers)) + def _subscribe_events( self, agent_event_queue: IAgentEventQueue,