Agent: Return a sequence from InfectionMonkey._build_server_list()

This commit is contained in:
Mike Salvatore 2022-09-27 19:20:54 -04:00 committed by Shreya Malviya
parent 5e129fd137
commit 082bb3bb6f
1 changed files with 3 additions and 3 deletions

View File

@ -5,7 +5,7 @@ import subprocess
import sys import sys
from ipaddress import IPv4Interface from ipaddress import IPv4Interface
from pathlib import Path, WindowsPath from pathlib import Path, WindowsPath
from typing import List, Optional, Tuple from typing import List, Optional, Sequence, Tuple
from pubsub.core import Publisher from pubsub.core import Publisher
@ -258,10 +258,10 @@ 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) -> Sequence[str]:
my_servers = set(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 = {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): def _build_master(self, relay_port: int):
servers = self._build_server_list(relay_port) servers = self._build_server_list(relay_port)