Agent: Modify ControlChannel to use AgentConfiguration endpoint

This commit is contained in:
Ilija Lazoroski 2022-06-24 20:00:39 +02:00 committed by Mike Salvatore
parent 98a9fd3285
commit b564e71d89
1 changed files with 2 additions and 3 deletions

View File

@ -52,17 +52,16 @@ class ControlChannel(IControlChannel):
def get_config(self) -> AgentConfiguration:
try:
response = requests.get( # noqa: DUO123
f"https://{self._control_channel_server}/api/agent",
f"https://{self._control_channel_server}/api/agent-configuration",
verify=False,
proxies=self._proxies,
timeout=SHORT_REQUEST_TIMEOUT,
)
response.raise_for_status()
config_dict = json.loads(response.text)["config"]
logger.debug(f"Received configuration:\n{pformat(json.loads(response.text))}")
return AgentConfiguration.from_mapping(config_dict)
return AgentConfiguration.from_json(response.text)
except (
json.JSONDecodeError,
requests.exceptions.ConnectionError,