From dc9b91d43096a13c5ae11af8b7d9f6cf02dad02c Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 24 Jun 2022 15:32:06 -0400 Subject: [PATCH] Agent: Use Iterable instead of List in type hint --- monkey/infection_monkey/master/automated_master.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/master/automated_master.py b/monkey/infection_monkey/master/automated_master.py index e955311b5..c347e8627 100644 --- a/monkey/infection_monkey/master/automated_master.py +++ b/monkey/infection_monkey/master/automated_master.py @@ -1,7 +1,7 @@ import logging import threading import time -from typing import Any, Callable, Dict, List, Optional, Tuple +from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple from common.configuration import PluginConfiguration from common.utils import Timer @@ -212,7 +212,7 @@ class AutomatedMaster(IMaster): def _run_pbas( self, - plugins: List[PluginConfiguration], + plugins: Iterable[PluginConfiguration], callback: Callable[[Any], None], custom_pba_options: Dict, ): @@ -226,7 +226,10 @@ class AutomatedMaster(IMaster): ) def _run_plugins( - self, plugins: List[PluginConfiguration], plugin_type: str, callback: Callable[[Any], None] + self, + plugins: Iterable[PluginConfiguration], + plugin_type: str, + callback: Callable[[Any], None], ): logger.info(f"Running {plugin_type}s") logger.debug(f"Found {len(plugins)} {plugin_type}(s) to run")