From 3f33bc4a414130c3a8fc71f76f372ccc53993ebc Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Wed, 6 Oct 2021 18:05:30 +0200 Subject: [PATCH] Agent: Consistent format string for set proxy --- monkey/infection_monkey/control.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/monkey/infection_monkey/control.py b/monkey/infection_monkey/control.py index 4252b53c0..ec153f418 100644 --- a/monkey/infection_monkey/control.py +++ b/monkey/infection_monkey/control.py @@ -36,8 +36,6 @@ PBA_FILE_DOWNLOAD = "https://%s/api/pba/download/%s" # elsewhere. TIMEOUT_IN_SECONDS = 15 -PROXY_SCHEMA = "%s:%s" - class ControlClient(object): proxies = {} @@ -132,13 +130,9 @@ class ControlClient(object): proxy_address, proxy_port = proxy_find logger.info("Found tunnel at %s:%s" % (proxy_address, proxy_port)) if is_windows_os(): - ControlClient.proxies["https"] = "http://%s:%s" % ( - proxy_address, - proxy_port, - ) + ControlClient.proxies["https"] = f"http://{proxy_address}:{proxy_port}" else: - ControlClient.proxies["https"] = PROXY_SCHEMA % (proxy_address, proxy_port) - logger.info(ControlClient.proxies) + ControlClient.proxies["https"] = f"{proxy_address}:{proxy_port}" @staticmethod def keepalive():