From 898205a33bf0d87c3df4c117111fdcbaf0bf40f5 Mon Sep 17 00:00:00 2001 From: Mark Paronyan Date: Mon, 28 Sep 2026 05:08:30 +0000 Subject: [PATCH] fix(typing): resolve mypy errors in schemas.compute.vmware_nodes --- gns3server/schemas/compute/vmware_nodes.py | 17 ++++++++++------- pyproject.toml | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gns3server/schemas/compute/vmware_nodes.py b/gns3server/schemas/compute/vmware_nodes.py index ee670a2bc..f838419a3 100644 --- a/gns3server/schemas/compute/vmware_nodes.py +++ b/gns3server/schemas/compute/vmware_nodes.py @@ -62,9 +62,9 @@ class VMwareBase(BaseModel): Common VMware node properties. """ - name: str - vmx_path: str = Field(..., description="Path to the vmx file") - linked_clone: bool = Field(..., description="Whether the VM is a linked clone or not") + name: Optional[str] = None + vmx_path: Optional[str] = None + linked_clone: Optional[bool] = None 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") @@ -83,7 +83,9 @@ class VMwareCreate(VMwareBase): Properties to create a VMware node. """ - pass + name: str + vmx_path: str = Field(..., description="Path to the vmx file") + linked_clone: bool = Field(..., description="Whether the VM is a linked clone or not") class VMwareUpdate(VMwareBase): @@ -91,12 +93,13 @@ class VMwareUpdate(VMwareBase): Properties to update a VMware node. """ - name: Optional[str] = None - vmx_path: Optional[str] = None - linked_clone: Optional[bool] = None + pass class VMware(VMwareBase): + name: str + vmx_path: str = Field(..., description="Path to the vmx file") + linked_clone: bool = Field(..., description="Whether the VM is a linked clone or not") project_id: UUID = Field(..., description="Project ID") node_directory: Optional[str] = Field(None, description="Path to the node working directory (read only)") status: NodeStatus = Field(..., description="Container status (read only)") diff --git a/pyproject.toml b/pyproject.toml index 258447eb6..bbcbfa968 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -383,7 +383,6 @@ module = [ "gns3server.schemas.compute.nat_nodes", # 1 "gns3server.schemas.compute.qemu_nodes", # 1 "gns3server.schemas.compute.virtualbox_nodes", # 2 - "gns3server.schemas.compute.vmware_nodes", # 3 "gns3server.schemas.compute.vpcs_nodes", # 1 "gns3server.schemas.controller.appliances", # 1 "gns3server.schemas.controller.computes", # 6