Agent: Move master/threading_utils.py -> utils/threading.py

Both create_daemon_thread() and interruptable_iter() will need to be
used outside of the master.
This commit is contained in:
Mike Salvatore 2022-01-24 08:49:20 -05:00
parent df42d0752a
commit 0c877833c5
6 changed files with 5 additions and 6 deletions

View File

@ -11,10 +11,10 @@ from infection_monkey.network import NetworkInterface
from infection_monkey.telemetry.messengers.i_telemetry_messenger import ITelemetryMessenger
from infection_monkey.telemetry.post_breach_telem import PostBreachTelem
from infection_monkey.telemetry.system_info_telem import SystemInfoTelem
from infection_monkey.utils.threading import create_daemon_thread
from infection_monkey.utils.timer import Timer
from . import Exploiter, IPScanner, Propagator
from .threading_utils import create_daemon_thread
CHECK_ISLAND_FOR_STOP_COMMAND_INTERVAL_SEC = 5
CHECK_FOR_TERMINATE_INTERVAL_SEC = CHECK_ISLAND_FOR_STOP_COMMAND_INTERVAL_SEC / 5

View File

@ -7,8 +7,7 @@ from typing import Callable, Dict, List
from infection_monkey.i_puppet import ExploiterResultData, IPuppet
from infection_monkey.model import VictimHost
from .threading_utils import run_worker_threads
from infection_monkey.utils.threading import run_worker_threads
QUEUE_TIMEOUT = 2

View File

@ -13,9 +13,9 @@ from infection_monkey.i_puppet import (
PortStatus,
)
from infection_monkey.network import NetworkAddress
from infection_monkey.utils.threading import run_worker_threads
from . import IPScanResults
from .threading_utils import run_worker_threads
logger = logging.getLogger()

View File

@ -16,9 +16,9 @@ from infection_monkey.network.scan_target_generator import compile_scan_target_l
from infection_monkey.telemetry.exploit_telem import ExploitTelem
from infection_monkey.telemetry.messengers.i_telemetry_messenger import ITelemetryMessenger
from infection_monkey.telemetry.scan_telem import ScanTelem
from infection_monkey.utils.threading import create_daemon_thread
from . import Exploiter, IPScanner, IPScanResults
from .threading_utils import create_daemon_thread
logger = logging.getLogger()

View File

@ -1,7 +1,7 @@
import logging
from threading import Event
from infection_monkey.master.threading_utils import create_daemon_thread, interruptable_iter
from infection_monkey.utils.threading import create_daemon_thread, interruptable_iter
def test_create_daemon_thread():