From 7b79c297b9a3616b1b8fd92f537dff42e4056b71 Mon Sep 17 00:00:00 2001 From: Shreya Date: Tue, 20 Jul 2021 16:31:28 +0530 Subject: [PATCH] island: Replace config "filter" for "manipulator" as file names/constants/functions --- monkey/monkey_island/cc/services/config_manipulator.py | 10 +++++----- .../{config_filters.py => config_manipulators.py} | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) rename monkey/monkey_island/cc/services/{config_filters.py => config_manipulators.py} (88%) diff --git a/monkey/monkey_island/cc/services/config_manipulator.py b/monkey/monkey_island/cc/services/config_manipulator.py index c45ea6f00..41f555be4 100644 --- a/monkey/monkey_island/cc/services/config_manipulator.py +++ b/monkey/monkey_island/cc/services/config_manipulator.py @@ -3,7 +3,7 @@ from typing import Dict import dpath.util import monkey_island.cc.services.config as config_service -from monkey_island.cc.services.config_filters import FILTER_PER_MODE +from monkey_island.cc.services.config_manipulators import MANIPULATOR_PER_MODE from monkey_island.cc.services.mode.mode_enum import IslandModeEnum @@ -20,12 +20,12 @@ def update_config_per_mode(mode: str, config: Dict, should_encrypt: bool) -> boo 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) + config_manipulator = MANIPULATOR_PER_MODE[mode] + config = _apply_config_manipulator(config, config_manipulator) return config -def _apply_config_filter(config: Dict, config_filter: Dict): - for path, value in config_filter.items(): +def _apply_config_manipulator(config: Dict, config_manipulator: Dict): + for path, value in config_manipulator.items(): dpath.util.set(config, path, value, ".") return config diff --git a/monkey/monkey_island/cc/services/config_filters.py b/monkey/monkey_island/cc/services/config_manipulators.py similarity index 88% rename from monkey/monkey_island/cc/services/config_filters.py rename to monkey/monkey_island/cc/services/config_manipulators.py index f8afd114d..291892371 100644 --- a/monkey/monkey_island/cc/services/config_filters.py +++ b/monkey/monkey_island/cc/services/config_manipulators.py @@ -1,6 +1,6 @@ from monkey_island.cc.services.mode.mode_enum import IslandModeEnum -FILTER_PER_MODE = { +MANIPULATOR_PER_MODE = { IslandModeEnum.ADVANCED.value: {}, IslandModeEnum.RANSOMWARE.value: {"monkey.post_breach.post_breach_actions": []}, }