Agent: Log configuration when it's received from the Island

This commit is contained in:
Mike Salvatore 2022-06-24 15:16:43 -04:00
parent b219ca0917
commit 33ec4f7ae9
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import json import json
import logging import logging
from pprint import pformat
from typing import Mapping from typing import Mapping
import requests import requests
@ -58,7 +59,10 @@ class ControlChannel(IControlChannel):
) )
response.raise_for_status() response.raise_for_status()
return AgentConfiguration.from_mapping(json.loads(response.text)["config"]) config_dict = json.loads(response.text)["config"]
logger.debug(f"Received configuration:\n{pformat(json.loads(response.text))}")
return AgentConfiguration.from_mapping(config_dict)
except ( except (
json.JSONDecodeError, json.JSONDecodeError,
requests.exceptions.ConnectionError, requests.exceptions.ConnectionError,