Agent: Fix AgentConfiguration object creation logic in ControlChannel.get_config()

This commit is contained in:
Shreya Malviya 2022-09-02 11:08:12 +05:30
parent 0f21ad2e09
commit f841bc041b
1 changed files with 4 additions and 2 deletions

View File

@ -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,