Fix enum use in schemas

This commit is contained in:
grossmj committed 2022-07-26 23:17:39 +02:00
1 parent bd9af3fe90
commit 31ae70894e
5 files changed
+33 -33

No files matched your search

+5 -5
View File
@@ -22,7 +22,7 @@ from uuid import UUID
from ..common import NodeStatus
class HostInterfaceType(Enum):
class HostInterfaceType(str, Enum):
ethernet = "ethernet"
tap = "tap"
@@ -38,7 +38,7 @@ class HostInterface(BaseModel):
special: bool = Field(..., description="Whether the interface is non standard")
class EthernetType(Enum):
class EthernetType(str, Enum):
ethernet = "ethernet"
@@ -53,7 +53,7 @@ class EthernetPort(BaseModel):
interface: str
class TAPType(Enum):
class TAPType(str, Enum):
tap = "tap"
@@ -68,7 +68,7 @@ class TAPPort(BaseModel):
interface: str
class UDPType(Enum):
class UDPType(str, Enum):
udp = "udp"
@@ -85,7 +85,7 @@ class UDPPort(BaseModel):
rport: int = Field(..., gt=0, le=65535, description="Remote port")
class CloudConsoleType(Enum):
class CloudConsoleType(str, Enum):
telnet = "telnet"
vnc = "vnc"
@@ -22,14 +22,14 @@ from enum import Enum
from ..common import NodeStatus
class EthernetSwitchPortType(Enum):
class EthernetSwitchPortType(str, Enum):
access = "access"
dot1q = "dot1q"
qinq = "qinq"
class EthernetSwitchEtherType(Enum):
class EthernetSwitchEtherType(str, Enum):
ethertype_8021q = "0x8100"
ethertype_qinq = "0x88A8"
+4 -4
View File
@@ -22,7 +22,7 @@ from uuid import UUID
from ..common import NodeStatus
class HostInterfaceType(Enum):
class HostInterfaceType(str, Enum):
ethernet = "ethernet"
tap = "tap"
@@ -38,7 +38,7 @@ class HostInterface(BaseModel):
special: bool = Field(..., description="Whether the interface is non standard")
class EthernetType(Enum):
class EthernetType(str, Enum):
ethernet = "ethernet"
@@ -53,7 +53,7 @@ class EthernetPort(BaseModel):
interface: str
class TAPType(Enum):
class TAPType(str, Enum):
tap = "tap"
@@ -68,7 +68,7 @@ class TAPPort(BaseModel):
interface: str
class UDPType(Enum):
class UDPType(str, Enum):
udp = "udp"
+3 -3
View File
@@ -20,7 +20,7 @@ from typing import Optional
from enum import Enum
class UDPNIOType(Enum):
class UDPNIOType(str, Enum):
udp = "nio_udp"
@@ -38,7 +38,7 @@ class UDPNIO(BaseModel):
filters: Optional[dict] = Field(None, description="Packet filters")
class EthernetNIOType(Enum):
class EthernetNIOType(str, Enum):
ethernet = "nio_ethernet"
@@ -52,7 +52,7 @@ class EthernetNIO(BaseModel):
ethernet_device: str = Field(..., description="Ethernet device name e.g. eth0")
class TAPNIOType(Enum):
class TAPNIOType(str, Enum):
tap = "nio_tap"