forked from p15670423/monkey
BB: Remove unused apply_template_to_config() from IslandConfigParser
This commit is contained in:
parent
7d98d14d3a
commit
5d9e525ecc
|
@ -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", ".")
|
||||||
|
|
Loading…
Reference in New Issue