From aa7941411f7a06748936b0fef8569cd869de4bcb Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 05:08:23 +0000 Subject: [PATCH] fix(typing): resolve mypy errors in schemas.compute.iou_nodes --- gns3server/schemas/compute/iou_nodes.py | 17 ++++++++++------- pyproject.toml | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gns3server/schemas/compute/iou_nodes.py b/gns3server/schemas/compute/iou_nodes.py index f4dd42ce5..e51fa1a28 100644 --- a/gns3server/schemas/compute/iou_nodes.py +++ b/gns3server/schemas/compute/iou_nodes.py @@ -26,9 +26,9 @@ class IOUBase(BaseModel): Common IOU node properties. """ - name: str - path: str = Field(..., description="IOU executable path") - application_id: int = Field(..., description="Application ID for running IOU executable") + name: Optional[str] = None + path: Optional[str] = Field(None, description="IOU executable path") + application_id: Optional[int] = Field(None, description="Application ID for running IOU executable") node_id: Optional[UUID] = None usage: Optional[str] = Field(None, description="How to use the node") console: Optional[int] = Field(None, gt=0, le=65535, description="Console TCP port") @@ -52,7 +52,9 @@ class IOUCreate(IOUBase): Properties to create an IOU node. """ - pass + name: str + path: str = Field(..., description="IOU executable path") + application_id: int = Field(..., description="Application ID for running IOU executable") class IOUUpdate(IOUBase): @@ -60,12 +62,13 @@ class IOUUpdate(IOUBase): Properties to update an IOU node. """ - name: Optional[str] = None - path: Optional[str] = Field(None, description="IOU executable path") - application_id: Optional[int] = Field(None, description="Application ID for running IOU executable") + pass class IOU(IOUBase): + name: str + path: str = Field(..., description="IOU executable path") + application_id: int = Field(..., description="Application ID for running IOU executable") project_id: UUID = Field(..., description="Project ID") node_directory: str = Field(..., description="Path to the node working directory (read only)") command_line: str = Field(..., description="Last command line used to start IOU (read only)") diff --git a/pyproject.toml b/pyproject.toml index 2d68270a4..4c502006b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -376,7 +376,6 @@ module = [ "gns3server.db.tasks", # 12 "gns3server.schemas.compute.atm_switch_nodes", # 5 "gns3server.schemas.compute.dynamips_nodes", # 1 - "gns3server.schemas.compute.iou_nodes", # 3 "gns3server.schemas.compute.nat_nodes", # 1 "gns3server.schemas.compute.qemu_nodes", # 1 "gns3server.schemas.compute.virtualbox_nodes", # 2