From d5736df56d00b1806e9d19d4aaec4d0f1397c8cb Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Thu, 21 Jul 2022 11:53:29 +0530 Subject: [PATCH] BB: Modify IslandConfigParser to return serialized config --- .../blackbox/island_client/island_config_parser.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/envs/monkey_zoo/blackbox/island_client/island_config_parser.py b/envs/monkey_zoo/blackbox/island_client/island_config_parser.py index eda2def01..9bc9afbcd 100644 --- a/envs/monkey_zoo/blackbox/island_client/island_config_parser.py +++ b/envs/monkey_zoo/blackbox/island_client/island_config_parser.py @@ -3,20 +3,17 @@ import json import dpath.util from typing_extensions import Type +from common.configuration.agent_configuration import AgentConfiguration from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate from envs.monkey_zoo.blackbox.island_client.monkey_island_client import MonkeyIslandClient class IslandConfigParser: @staticmethod - def get_raw_config( - config_template: Type[ConfigTemplate], island_client: MonkeyIslandClient + def get_serialized_config( + agent_configuration: AgentConfiguration, island_client: MonkeyIslandClient ) -> str: - response = island_client.get_config() - config = IslandConfigParser.apply_template_to_config( - config_template, response["configuration"] - ) - return json.dumps(config) + return agent_configuration.to_json() @staticmethod def apply_template_to_config(config_template: Type[ConfigTemplate], config: dict) -> dict: