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