From f841bc041b580486f9e2650126b494212f7b44da Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Fri, 2 Sep 2022 11:08:12 +0530 Subject: [PATCH] Agent: Fix AgentConfiguration object creation logic in ControlChannel.get_config() --- monkey/infection_monkey/master/control_channel.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/master/control_channel.py b/monkey/infection_monkey/master/control_channel.py index 93fa67fa6..713ac3aac 100644 --- a/monkey/infection_monkey/master/control_channel.py +++ b/monkey/infection_monkey/master/control_channel.py @@ -93,9 +93,11 @@ class ControlChannel(IControlChannel): ) response.raise_for_status() - logger.debug(f"Received configuration:\n{pformat(json.loads(response.text))}") + config_dict = json.loads(response.text) - return AgentConfiguration.from_json(response.text) + logger.debug(f"Received configuration:\n{pformat(config_dict)}") + + return AgentConfiguration(**config_dict) except ( json.JSONDecodeError, requests.exceptions.ConnectionError,