From 0f848eb28439f56e34d3952e8f30c16fc8be7aef Mon Sep 17 00:00:00 2001 From: vakaris_zilius Date: Thu, 23 Jun 2022 15:08:20 +0000 Subject: [PATCH] Agent: Usa agent config object instead of dict should_propagate --- monkey/infection_monkey/utils/propagation.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/utils/propagation.py b/monkey/infection_monkey/utils/propagation.py index 004bafdd2..9cfccab51 100644 --- a/monkey/infection_monkey/utils/propagation.py +++ b/monkey/infection_monkey/utils/propagation.py @@ -1,2 +1,5 @@ -def should_propagate(config: dict, current_depth: int) -> bool: - return config["config"]["depth"] > current_depth +from common.configuration import AgentConfiguration + + +def should_propagate(config: AgentConfiguration, current_depth: int) -> bool: + return config.propagation.maximum_depth > current_depth