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,