From 2d338fc81f97f64da23764430688a44d8135228b Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 22 Jul 2022 12:29:41 -0400 Subject: [PATCH] BB: Use to_mapping() to send agent configuration JSON --- .../monkey_zoo/blackbox/island_client/monkey_island_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py b/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py index 71f9f200c..b687890b0 100644 --- a/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py +++ b/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py @@ -5,6 +5,7 @@ from typing import Union from bson import json_util +from common.configuration import AgentConfiguration from envs.monkey_zoo.blackbox.island_client.monkey_island_requests import MonkeyIslandRequests from envs.monkey_zoo.blackbox.test_configurations.test_configuration import TestConfiguration @@ -33,7 +34,8 @@ class MonkeyIslandClient(object): @avoid_race_condition def import_config(self, test_configuration: TestConfiguration): self.requests.post( - "api/agent-configuration", data=test_configuration.agent_configuration.to_json() + "api/agent-configuration", + data=AgentConfiguration.to_mapping(test_configuration.agent_configuration), ) serialized_propagation_credentials = json.dumps( [credential.to_json() for credential in test_configuration.propagation_credentials]