From 78d32053a219551006743737e27b71dfbcd8f3ad Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 8 Sep 2022 13:30:56 +0530 Subject: [PATCH] Agent: Rename send_relay_control_message -> send_remove_from_waitlist_control_message_to_relays --- monkey/infection_monkey/monkey.py | 7 +++++-- monkey/infection_monkey/network/relay/utils.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 4a8685aae..6d8e6bac6 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -42,7 +42,10 @@ from infection_monkey.master.control_channel import ControlChannel from infection_monkey.model import VictimHostFactory from infection_monkey.network.firewall import app as firewall from infection_monkey.network.info import get_network_interfaces -from infection_monkey.network.relay.utils import find_server, send_relay_control_message +from infection_monkey.network.relay.utils import ( + find_server, + send_remove_from_waitlist_control_message_to_relays, +) from infection_monkey.network_scanning.elasticsearch_fingerprinter import ElasticSearchFingerprinter from infection_monkey.network_scanning.http_fingerprinter import HTTPFingerprinter from infection_monkey.network_scanning.mssql_fingerprinter import MSSQLFingerprinter @@ -131,7 +134,7 @@ class InfectionMonkey: raise Exception( f"Failed to connect to the island via any known servers: {self._opts.servers}" ) - send_relay_control_message(servers_iterator) + send_remove_from_waitlist_control_message_to_relays(servers_iterator) return server diff --git a/monkey/infection_monkey/network/relay/utils.py b/monkey/infection_monkey/network/relay/utils.py index c6f479f8a..91bbf75fc 100644 --- a/monkey/infection_monkey/network/relay/utils.py +++ b/monkey/infection_monkey/network/relay/utils.py @@ -38,7 +38,7 @@ def find_server(servers: Iterable[str]) -> Optional[str]: return None -def send_relay_control_message(servers: Iterable[str]): +def send_remove_from_waitlist_control_message_to_relays(servers: Iterable[str]): for server in servers: t = create_daemon_thread( target=_open_socket_to_server,