Agent: Return set when building server list

This commit is contained in:
Ilija Lazoroski 2022-09-27 16:37:03 +02:00 committed by Shreya Malviya
parent 799aae4498
commit 9ada95c126
1 changed files with 3 additions and 3 deletions

View File

@ -259,9 +259,9 @@ class InfectionMonkey:
return agent_event_serializer_registry return agent_event_serializer_registry
def _build_server_list(self, relay_port: int): def _build_server_list(self, relay_port: int):
my_servers = map(str, self._opts.servers) my_servers = set(map(str, self._opts.servers))
relay_servers = [f"{ip}:{relay_port}" for ip in get_my_ip_addresses()] relay_servers = set([f"{ip}:{relay_port}" for ip in get_my_ip_addresses()])
return my_servers + relay_servers return my_servers.union(relay_servers)
def _build_master(self, relay_port: int): def _build_master(self, relay_port: int):
servers = self._build_server_list(relay_port) servers = self._build_server_list(relay_port)