From 082bb3bb6f205509d4925a613356a9d9873c15ce Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 27 Sep 2022 19:20:54 -0400 Subject: [PATCH] Agent: Return a sequence from InfectionMonkey._build_server_list() --- 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 f04b1b72a..4b235133c 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -5,7 +5,7 @@ import subprocess import sys from ipaddress import IPv4Interface from pathlib import Path, WindowsPath -from typing import List, Optional, Tuple +from typing import List, Optional, Sequence, Tuple from pubsub.core import Publisher @@ -258,10 +258,10 @@ class InfectionMonkey: return agent_event_serializer_registry - def _build_server_list(self, relay_port: int): + 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 my_servers.union(relay_servers) + return list(my_servers.union(relay_servers)) def _build_master(self, relay_port: int): servers = self._build_server_list(relay_port)