From af86cb088f1fbd47068bbf30ad13a55a7dcb3692 Mon Sep 17 00:00:00 2001 From: Shreya Date: Tue, 20 Jul 2021 16:26:32 +0530 Subject: [PATCH] island: Fix stuff in `config_manipulator.py` after testing --- .../monkey_island/cc/services/config_manipulator.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/monkey/monkey_island/cc/services/config_manipulator.py b/monkey/monkey_island/cc/services/config_manipulator.py index 21ca693c1..c45ea6f00 100644 --- a/monkey/monkey_island/cc/services/config_manipulator.py +++ b/monkey/monkey_island/cc/services/config_manipulator.py @@ -9,16 +9,18 @@ from monkey_island.cc.services.mode.mode_enum import IslandModeEnum def update_config_on_mode_set(mode: IslandModeEnum) -> bool: config = config_service.ConfigService.get_config() - return update_config_per_mode(mode, config, True) + return update_config_per_mode(mode.value, config, True) -def update_config_per_mode(mode: IslandModeEnum, config: Dict, should_encrypt: bool) -> bool: +def update_config_per_mode(mode: str, config: Dict, should_encrypt: bool) -> bool: config = _set_default_config_values_per_mode(mode, config) - return config_service.ConfigService.update_config(config_json=config, should_encrypt=True) + return config_service.ConfigService.update_config( + config_json=config, should_encrypt=should_encrypt + ) -def _set_default_config_values_per_mode(mode: IslandModeEnum, config: Dict) -> Dict: - config_filter = FILTER_PER_MODE[mode.value] +def _set_default_config_values_per_mode(mode: str, config: Dict) -> Dict: + config_filter = FILTER_PER_MODE[mode] config = _apply_config_filter(config, config_filter) return config