fix(typing): resolve mypy errors in schemas.controller.templates.vmware_templates

This commit is contained in:
Mark Paronyan 2026-09-28 04:49:56 +00:00
parent edaf9a4377
commit 79862d900a
No known key found for this signature in database
GPG Key ID: 8DC7338A87FE22F8
2 changed files with 8 additions and 5 deletions

View File

@ -27,11 +27,11 @@ from pydantic import Field
from typing import Optional, List
class VMwareTemplate(TemplateBase):
class VMwareTemplateBase(TemplateBase):
category: Optional[Category] = Category.guest
default_name_format: Optional[str] = "{name}-{0}"
symbol: Optional[str] = "vmware_guest"
vmx_path: str = Field(..., description="Path to the vmx file")
vmx_path: Optional[str] = Field(None, description="Path to the vmx file")
linked_clone: Optional[bool] = Field(False, description="Whether the VM is a linked clone or not")
first_port_name: Optional[str] = Field("", description="Optional name of the first networking port example: eth0")
port_name_format: Optional[str] = Field(
@ -57,5 +57,9 @@ class VMwareTemplate(TemplateBase):
custom_adapters: Optional[List[CustomAdapter]] = Field(default_factory=list, description="Custom adapters")
class VMwareTemplateUpdate(VMwareTemplate):
vmx_path: Optional[str] = Field(None, description="Path to the vmx file")
class VMwareTemplate(VMwareTemplateBase):
vmx_path: str = Field(..., description="Path to the vmx file")
class VMwareTemplateUpdate(VMwareTemplateBase):
pass

View File

@ -391,7 +391,6 @@ module = [
"gns3server.schemas.controller.projects", # 2
"gns3server.schemas.controller.settings", # 3
"gns3server.schemas.controller.templates.docker_templates", # 1
"gns3server.schemas.controller.templates.vmware_templates", # 1
"gns3server.schemas.qemu_disk_image", # 2
"gns3server.services.computes", # 4
"gns3server.services.templates", # 18