From 92636da4b2b5b5ab87f68c2f0639ded217060042 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 26 Jan 2022 08:13:35 -0500 Subject: [PATCH] Agent: Use Iterable instead of List for type hint in run_plugins() --- monkey/infection_monkey/master/automated_master.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monkey/infection_monkey/master/automated_master.py b/monkey/infection_monkey/master/automated_master.py index 99bed4a3c..d30f1d819 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, Tuple +from typing import Any, Callable, Dict, Iterable, List, Tuple from infection_monkey.i_control_channel import IControlChannel, IslandCommunicationError from infection_monkey.i_master import IMaster @@ -191,7 +191,9 @@ class AutomatedMaster(IMaster): self._puppet.run_payload(name, options, self._stop) - def _run_plugins(self, plugins: List[Any], plugin_type: str, callback: Callable[[Any], None]): + def _run_plugins( + self, plugins: Iterable[Any], 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")