BB: Remove unused apply_template_to_config() from IslandConfigParser

This commit is contained in:
Shreya Malviya 2022-07-21 12:09:49 +05:30 committed by Mike Salvatore
parent 7d98d14d3a
commit 5d9e525ecc
1 changed files with 0 additions and 8 deletions

View File

@ -1,10 +1,8 @@
import json import json
import dpath.util import dpath.util
from typing_extensions import Type
from common.configuration.agent_configuration import AgentConfiguration from common.configuration.agent_configuration import AgentConfiguration
from envs.monkey_zoo.blackbox.config_templates.config_template import ConfigTemplate
class IslandConfigParser: class IslandConfigParser:
@ -12,12 +10,6 @@ class IslandConfigParser:
def get_serialized_config(agent_configuration: AgentConfiguration) -> str: def get_serialized_config(agent_configuration: AgentConfiguration) -> str:
return agent_configuration.to_json() return agent_configuration.to_json()
@staticmethod
def apply_template_to_config(config_template: Type[ConfigTemplate], config: dict) -> dict:
for path, value in config_template.config_values.items():
dpath.util.set(config, path, value, ".")
return config
@staticmethod @staticmethod
def get_ips_of_targets(raw_config): def get_ips_of_targets(raw_config):
return dpath.util.get(json.loads(raw_config), "basic_network.scope.subnet_scan_list", ".") return dpath.util.get(json.loads(raw_config), "basic_network.scope.subnet_scan_list", ".")