From 5e129fd137f208331614d8e7e8c9b71aecbe4868 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 27 Sep 2022 19:19:05 -0400 Subject: [PATCH] Agent: Use set comprehension instead of set(list()) --- monkey/infection_monkey/monkey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index cccc7af9b..f04b1b72a 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -260,7 +260,7 @@ class InfectionMonkey: def _build_server_list(self, relay_port: int): my_servers = set(map(str, self._opts.servers)) - relay_servers = set([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) def _build_master(self, relay_port: int):