forked from p34709852/monkey
BB: Use to_mapping() to send agent configuration JSON
This commit is contained in:
parent
9d6b0c5a61
commit
2d338fc81f
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue