diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 1af0266bb..2a70b763c 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -96,9 +96,11 @@ class InfectionMonkey: logger.info("Monkey is initializing...") self._singleton = SystemSingleton() self._opts = self._get_arguments(args) - # TODO: Change address to ip port to use list of servers - self._cmd_island_ip, self._cmd_island_port = address_to_ip_port(self._opts.servers) - self._control_client = ControlClient(self._opts.servers) + + server = find_server(self._opts.servers) + self._cmd_island_ip, self._cmd_island_port = address_to_ip_port(server) + self._control_client = ControlClient(server_address=server) + # TODO Refactor the telemetry messengers to accept control client # and remove control_client_object ControlClient.control_client_object = self._control_client