diff --git a/monkey/common/types.py b/monkey/common/types.py index 56dee91a5..a76fd560f 100644 --- a/monkey/common/types.py +++ b/monkey/common/types.py @@ -5,3 +5,4 @@ from typing_extensions import TypeAlias AgentID: TypeAlias = UUID HardwareID: TypeAlias = PositiveInt +MachineID: TypeAlias = PositiveInt diff --git a/monkey/monkey_island/cc/models/__init__.py b/monkey/monkey_island/cc/models/__init__.py index 30cb5ad95..65e63fe14 100644 --- a/monkey/monkey_island/cc/models/__init__.py +++ b/monkey/monkey_island/cc/models/__init__.py @@ -9,7 +9,8 @@ from .pba_results import PbaResults from monkey_island.cc.models.report.report import Report from .simulation import Simulation, IslandMode from .user_credentials import UserCredentials -from .machine import Machine, MachineID +from common.types import MachineID +from .machine import Machine from .communication_type import CommunicationType from .node import Node from common.types import AgentID diff --git a/monkey/monkey_island/cc/models/machine.py b/monkey/monkey_island/cc/models/machine.py index 31299d169..90fa0be00 100644 --- a/monkey/monkey_island/cc/models/machine.py +++ b/monkey/monkey_island/cc/models/machine.py @@ -1,15 +1,14 @@ from ipaddress import IPv4Interface from typing import Optional, Sequence -from pydantic import Field, PositiveInt, validator -from typing_extensions import TypeAlias +from pydantic import Field, validator from common import OperatingSystem from common.base_models import MutableInfectionMonkeyBaseModel from common.transforms import make_immutable_sequence from common.types import HardwareID -MachineID: TypeAlias = PositiveInt +from . import MachineID class Machine(MutableInfectionMonkeyBaseModel):