From d596e8c59356663347ae05743c18dc20cfd109ee Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 29 Mar 2022 14:24:31 -0400 Subject: [PATCH] Agent: Rename typing to custom_types Naming the module "typing" and then importing from "typing" within the module itself caused some confusion for python and resulted in failed builds. --- .../credential_store/aggregating_credentials_store.py | 2 +- monkey/infection_monkey/credential_store/i_credentials_store.py | 2 +- monkey/infection_monkey/{typing.py => custom_types.py} | 0 monkey/infection_monkey/master/control_channel.py | 2 +- monkey/infection_monkey/master/exploiter.py | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename monkey/infection_monkey/{typing.py => custom_types.py} (100%) diff --git a/monkey/infection_monkey/credential_store/aggregating_credentials_store.py b/monkey/infection_monkey/credential_store/aggregating_credentials_store.py index eef6f72fc..27ead7d26 100644 --- a/monkey/infection_monkey/credential_store/aggregating_credentials_store.py +++ b/monkey/infection_monkey/credential_store/aggregating_credentials_store.py @@ -2,9 +2,9 @@ import logging from typing import Any, Iterable, Mapping from common.common_consts.credential_component_type import CredentialComponentType +from infection_monkey.custom_types import PropagationCredentials from infection_monkey.i_control_channel import IControlChannel from infection_monkey.i_puppet import Credentials -from infection_monkey.typing import PropagationCredentials from infection_monkey.utils.decorators import request_cache from .i_credentials_store import ICredentialsStore diff --git a/monkey/infection_monkey/credential_store/i_credentials_store.py b/monkey/infection_monkey/credential_store/i_credentials_store.py index 72ef12d44..711c77a89 100644 --- a/monkey/infection_monkey/credential_store/i_credentials_store.py +++ b/monkey/infection_monkey/credential_store/i_credentials_store.py @@ -1,8 +1,8 @@ import abc from typing import Iterable +from infection_monkey.custom_types import PropagationCredentials from infection_monkey.i_puppet import Credentials -from infection_monkey.typing import PropagationCredentials class ICredentialsStore(metaclass=abc.ABCMeta): diff --git a/monkey/infection_monkey/typing.py b/monkey/infection_monkey/custom_types.py similarity index 100% rename from monkey/infection_monkey/typing.py rename to monkey/infection_monkey/custom_types.py diff --git a/monkey/infection_monkey/master/control_channel.py b/monkey/infection_monkey/master/control_channel.py index eb6dd12d5..7795a35f7 100644 --- a/monkey/infection_monkey/master/control_channel.py +++ b/monkey/infection_monkey/master/control_channel.py @@ -6,8 +6,8 @@ import requests from common.common_consts.timeouts import SHORT_REQUEST_TIMEOUT from infection_monkey.config import WormConfiguration from infection_monkey.control import ControlClient +from infection_monkey.custom_types import PropagationCredentials from infection_monkey.i_control_channel import IControlChannel, IslandCommunicationError -from infection_monkey.typing import PropagationCredentials requests.packages.urllib3.disable_warnings() diff --git a/monkey/infection_monkey/master/exploiter.py b/monkey/infection_monkey/master/exploiter.py index 5f8e25b4d..b9eada5b6 100644 --- a/monkey/infection_monkey/master/exploiter.py +++ b/monkey/infection_monkey/master/exploiter.py @@ -7,9 +7,9 @@ from queue import Queue from threading import Event from typing import Callable, Dict, List, Mapping +from infection_monkey.custom_types import PropagationCredentials from infection_monkey.i_puppet import ExploiterResultData, IPuppet from infection_monkey.model import VictimHost -from infection_monkey.typing import PropagationCredentials from infection_monkey.utils.threading import interruptible_iter, run_worker_threads QUEUE_TIMEOUT = 2