Update package versions.

Do not use Path in schemas (causes issues with empty paths).
Change how notifications are handled.
Run tests with Python 3.9
This commit is contained in:
grossmj committed 2020-11-11 17:18:41 +10:30
1 parent bf19da1dc2
commit acc5c7ebfa
26 files changed
+121 -134

No files matched your search

+3 -4
View File
@@ -18,7 +18,6 @@
from pydantic import BaseModel, Field
from typing import Optional, List
from pathlib import Path
from enum import Enum
from uuid import UUID
@@ -126,7 +125,7 @@ class DynamipsBase(BaseModel):
platform: Optional[DynamipsPlatform] = Field(None, description="Cisco router platform")
ram: Optional[int] = Field(None, description="Amount of RAM in MB")
nvram: Optional[int] = Field(None, description="Amount of NVRAM in KB")
image: Optional[Path] = Field(None, description="Path to the IOS image")
image: Optional[str] = Field(None, description="Path to the IOS image")
image_md5sum: Optional[str] = Field(None, description="Checksum of the IOS image")
usage: Optional[str] = Field(None, description="How to use the Dynamips VM")
chassis: Optional[str] = Field(None, description="Cisco router chassis model", regex="^[0-9]{4}(XM)?$")
@@ -173,7 +172,7 @@ class DynamipsCreate(DynamipsBase):
name: str
platform: str = Field(..., description="Cisco router platform", regex="^c[0-9]{4}$")
image: Path = Field(..., description="Path to the IOS image")
image: str = Field(..., description="Path to the IOS image")
ram: int = Field(..., description="Amount of RAM in MB")
@@ -192,4 +191,4 @@ class Dynamips(DynamipsBase):
project_id: UUID
dynamips_id: int
status: NodeStatus
node_directory: Optional[Path] = Field(None, description="Path to the vm working directory")
node_directory: Optional[str] = Field(None, description="Path to the vm working directory")
+1 -2
View File
@@ -26,7 +26,6 @@ from .dynamips_nodes import (
)
from pydantic import Field
from pathlib import Path
from typing import Optional
from enum import Enum
@@ -37,7 +36,7 @@ class DynamipsTemplate(TemplateBase):
default_name_format: Optional[str] = "R{0}"
symbol: Optional[str] = ":/symbols/router.svg"
platform: DynamipsPlatform = Field(..., description="Cisco router platform")
image: Path = Field(..., description="Path to the IOS image")
image: str = Field(..., description="Path to the IOS image")
exec_area: Optional[int] = Field(64, description="Exec area value")
mmap: Optional[bool] = Field(True, description="MMAP feature")
mac_addr: Optional[str] = Field("", description="Base MAC address", regex="^([0-9a-fA-F]{4}\\.){2}[0-9a-fA-F]{4}$|^$")
+2 -3
View File
@@ -16,7 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from pydantic import BaseModel, Field
from pathlib import Path
from typing import Optional
from uuid import UUID
@@ -29,7 +28,7 @@ class IOUBase(BaseModel):
"""
name: str
path: Path = Field(..., description="IOU executable path")
path: str = Field(..., description="IOU executable path")
application_id: int = Field(..., description="Application ID for running IOU executable")
node_id: Optional[UUID]
usage: Optional[str] = Field(None, description="How to use the node")
@@ -60,7 +59,7 @@ class IOUUpdate(IOUBase):
"""
name: Optional[str]
path: Optional[Path] = Field(None, description="IOU executable path")
path: Optional[str] = Field(None, description="IOU executable path")
application_id: Optional[int] = Field(None, description="Application ID for running IOU executable")
+1 -2
View File
@@ -20,7 +20,6 @@ from .templates import Category, TemplateBase
from .iou_nodes import ConsoleType
from pydantic import Field
from pathlib import Path
from typing import Optional
@@ -29,7 +28,7 @@ class IOUTemplate(TemplateBase):
category: Optional[Category] = "router"
default_name_format: Optional[str] = "IOU{0}"
symbol: Optional[str] = ":/symbols/multilayer_switch.svg"
path: Path = Field(..., description="Path of IOU executable")
path: str = Field(..., description="Path of IOU executable")
ethernet_adapters: Optional[int] = Field(2, description="Number of ethernet adapters")
serial_adapters: Optional[int] = Field(2, description="Number of serial adapters")
ram: Optional[int] = Field(256, description="Amount of RAM in MB")
+1 -2
View File
@@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from pathlib import Path
from pydantic import BaseModel, Field
from typing import List, Optional, Union
from enum import Enum
@@ -51,7 +50,7 @@ class Image(BaseModel):
"""
filename: str
path: Path
path: str
md5sum: Optional[str] = None
filesize: Optional[int] = None
+2 -3
View File
@@ -16,7 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from pathlib import Path
from pydantic import BaseModel, Field, HttpUrl
from typing import List, Optional
from uuid import UUID
@@ -51,7 +50,7 @@ class ProjectBase(BaseModel):
name: str
project_id: Optional[UUID] = None
path: Optional[Path] = Field(None, description="Project directory")
path: Optional[str] = Field(None, description="Project directory")
auto_close: Optional[bool] = Field(None, description="Close project when last client leaves")
auto_open: Optional[bool] = Field(None, description="Project opens when GNS3 starts")
auto_start: Optional[bool] = Field(None, description="Project starts when opened")
@@ -102,5 +101,5 @@ class Project(ProjectBase):
class ProjectFile(BaseModel):
path: Path = Field(..., description="File path")
path: str = Field(..., description="File path")
md5sum: str = Field(..., description="File checksum")
+12 -13
View File
@@ -16,7 +16,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from pydantic import BaseModel, Field
from pathlib import Path
from typing import Optional, List
from enum import Enum
from uuid import UUID
@@ -161,31 +160,31 @@ class QemuBase(BaseModel):
node_id: Optional[UUID]
usage: Optional[str] = Field(None, description="How to use the node")
linked_clone: Optional[bool] = Field(None, description="Whether the VM is a linked clone or not")
qemu_path: Optional[Path] = Field(None, description="Qemu executable path")
qemu_path: Optional[str] = Field(None, description="Qemu executable path")
platform: Optional[QemuPlatform] = Field(None, description="Platform to emulate")
console: Optional[int] = Field(None, gt=0, le=65535, description="Console TCP port")
console_type: Optional[QemuConsoleType] = Field(None, description="Console type")
aux: Optional[int] = Field(None, gt=0, le=65535, description="Auxiliary console TCP port")
aux_type: Optional[QemuConsoleType] = Field(None, description="Auxiliary console type")
hda_disk_image: Optional[Path] = Field(None, description="QEMU hda disk image path")
hda_disk_image: Optional[str] = Field(None, description="QEMU hda disk image path")
hda_disk_image_md5sum: Optional[str] = Field(None, description="QEMU hda disk image checksum")
hda_disk_interface: Optional[QemuDiskInterfaceType] = Field(None, description="QEMU hda interface")
hdb_disk_image: Optional[Path] = Field(None, description="QEMU hdb disk image path")
hdb_disk_image: Optional[str] = Field(None, description="QEMU hdb disk image path")
hdb_disk_image_md5sum: Optional[str] = Field(None, description="QEMU hdb disk image checksum")
hdb_disk_interface: Optional[QemuDiskInterfaceType] = Field(None, description="QEMU hdb interface")
hdc_disk_image: Optional[Path] = Field(None, description="QEMU hdc disk image path")
hdc_disk_image: Optional[str] = Field(None, description="QEMU hdc disk image path")
hdc_disk_image_md5sum: Optional[str] = Field(None, description="QEMU hdc disk image checksum")
hdc_disk_interface: Optional[QemuDiskInterfaceType] = Field(None, description="QEMU hdc interface")
hdd_disk_image: Optional[Path] = Field(None, description="QEMU hdd disk image path")
hdd_disk_image: Optional[str] = Field(None, description="QEMU hdd disk image path")
hdd_disk_image_md5sum: Optional[str] = Field(None, description="QEMU hdd disk image checksum")
hdd_disk_interface: Optional[QemuDiskInterfaceType] = Field(None, description="QEMU hdd interface")
cdrom_image: Optional[Path] = Field(None, description="QEMU cdrom image path")
cdrom_image: Optional[str] = Field(None, description="QEMU cdrom image path")
cdrom_image_md5sum: Optional[str] = Field(None, description="QEMU cdrom image checksum")
bios_image: Optional[Path] = Field(None, description="QEMU bios image path")
bios_image: Optional[str] = Field(None, description="QEMU bios image path")
bios_image_md5sum: Optional[str] = Field(None, description="QEMU bios image checksum")
initrd: Optional[Path] = Field(None, description="QEMU initrd path")
initrd: Optional[str] = Field(None, description="QEMU initrd path")
initrd_md5sum: Optional[str] = Field(None, description="QEMU initrd checksum")
kernel_image: Optional[Path] = Field(None, description="QEMU kernel image path")
kernel_image: Optional[str] = Field(None, description="QEMU kernel image path")
kernel_image_md5sum: Optional[str] = Field(None, description="QEMU kernel image checksum")
kernel_command_line: Optional[str] = Field(None, description="QEMU kernel command line")
boot_priority: Optional[QemuBootPriority] = Field(None, description="QEMU boot priority")
@@ -251,7 +250,7 @@ class QemuDiskResize(BaseModel):
class QemuBinaryPath(BaseModel):
path: Path
path: str
version: str
@@ -315,8 +314,8 @@ class QemuImageAdapterType(str, Enum):
class QemuImageBase(BaseModel):
qemu_img: Path = Field(..., description="Path to the qemu-img binary")
path: Path = Field(..., description="Absolute or relative path of the image")
qemu_img: str = Field(..., description="Path to the qemu-img binary")
path: str = Field(..., description="Absolute or relative path of the image")
format: QemuImageFormat = Field(..., description="Image format type")
size: int = Field(..., description="Image size in Megabytes")
preallocation: Optional[QemuImagePreallocation]
+9 -10
View File
@@ -28,7 +28,6 @@ from .qemu_nodes import (
CustomAdapter
)
from pathlib import Path
from pydantic import Field
from typing import Optional, List
@@ -38,7 +37,7 @@ class QemuTemplate(TemplateBase):
category: Optional[Category] = "guest"
default_name_format: Optional[str] = "{name}-{0}"
symbol: Optional[str] = ":/symbols/qemu_guest.svg"
qemu_path: Optional[Path] = Field("", description="Qemu executable path")
qemu_path: Optional[str] = Field("", description="Qemu executable path")
platform: Optional[QemuPlatform] = Field("i386", description="Platform to emulate")
linked_clone: Optional[bool] = Field(True, description="Whether the VM is a linked clone or not")
ram: Optional[int] = Field(256, description="Amount of RAM in MB")
@@ -54,18 +53,18 @@ class QemuTemplate(TemplateBase):
console_auto_start: Optional[bool] = Field(False, description="Automatically start the console when the node has started")
aux_type: Optional[QemuConsoleType] = Field("none", description="Auxiliary console type")
boot_priority: Optional[QemuBootPriority] = Field("c", description="QEMU boot priority")
hda_disk_image: Optional[Path] = Field("", description="QEMU hda disk image path")
hda_disk_image: Optional[str] = Field("", description="QEMU hda disk image path")
hda_disk_interface: Optional[QemuDiskInterfaceType] = Field("none", description="QEMU hda interface")
hdb_disk_image: Optional[Path] = Field("", description="QEMU hdb disk image path")
hdb_disk_image: Optional[str] = Field("", description="QEMU hdb disk image path")
hdb_disk_interface: Optional[QemuDiskInterfaceType] = Field("none", description="QEMU hdb interface")
hdc_disk_image: Optional[Path] = Field("", description="QEMU hdc disk image path")
hdc_disk_image: Optional[str] = Field("", description="QEMU hdc disk image path")
hdc_disk_interface: Optional[QemuDiskInterfaceType] = Field("none", description="QEMU hdc interface")
hdd_disk_image: Optional[Path] = Field("", description="QEMU hdd disk image path")
hdd_disk_image: Optional[str] = Field("", description="QEMU hdd disk image path")
hdd_disk_interface: Optional[QemuDiskInterfaceType] = Field("none", description="QEMU hdd interface")
cdrom_image: Optional[Path] = Field("", description="QEMU cdrom image path")
initrd: Optional[Path] = Field("", description="QEMU initrd path")
kernel_image: Optional[Path] = Field("", description="QEMU kernel image path")
bios_image: Optional[Path] = Field("", description="QEMU bios image path")
cdrom_image: Optional[str] = Field("", description="QEMU cdrom image path")
initrd: Optional[str] = Field("", description="QEMU initrd path")
kernel_image: Optional[str] = Field("", description="QEMU kernel image path")
bios_image: Optional[str] = Field("", description="QEMU bios image path")
kernel_command_line: Optional[str] = Field("", description="QEMU kernel command line")
legacy_networking: Optional[bool] = Field(False, description="Use QEMU legagy networking commands (-net syntax)")
replicate_network_connection_state: Optional[bool] = Field(True, description="Replicate the network connection state for links in Qemu")
+2 -3
View File
@@ -17,7 +17,6 @@
from pydantic import BaseModel, Field
from typing import Optional, List
from pathlib import Path
from enum import Enum
from uuid import UUID
@@ -64,7 +63,7 @@ class VMwareBase(BaseModel):
"""
name: str
vmx_path: Path = Field(..., description="Path to the vmx file")
vmx_path: str = Field(..., description="Path to the vmx file")
linked_clone: bool = Field(..., description="Whether the VM is a linked clone or not")
node_id: Optional[UUID]
usage: Optional[str] = Field(None, description="How to use the node")
@@ -93,7 +92,7 @@ class VMwareUpdate(VMwareBase):
"""
name: Optional[str]
vmx_path: Optional[Path]
vmx_path: Optional[str]
linked_clone: Optional[bool]
+1 -2
View File
@@ -24,7 +24,6 @@ from .vmware_nodes import (
CustomAdapter
)
from pathlib import Path
from pydantic import Field
from typing import Optional, List
@@ -34,7 +33,7 @@ class VMwareTemplate(TemplateBase):
category: Optional[Category] = "guest"
default_name_format: Optional[str] = "{name}-{0}"
symbol: Optional[str] = ":/symbols/vmware_guest.svg"
vmx_path: Path = Field(..., description="Path to the vmx file")
vmx_path: str = Field(..., 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("Ethernet{0}", description="Optional formatting of the networking port example: eth{0}")