correction
This commit is contained in:
@@ -4,7 +4,21 @@ from uuid import uuid4
|
||||
from pydantic import UUID4
|
||||
from pydantic_xml import BaseXmlModel, attr, element, wrapped
|
||||
|
||||
from deevirt_schema.libvirt.enum import YesNoEnum, OnOffEnum, UnitEnum
|
||||
from enum import Enum
|
||||
|
||||
class YesNoEnum(str, Enum):
|
||||
YES = "yes"
|
||||
NO = "no"
|
||||
|
||||
class OnOffEnum(str, Enum):
|
||||
ON = "on"
|
||||
OFF = "off"
|
||||
|
||||
class UnitEnum(str, Enum):
|
||||
KiB = "KiB"
|
||||
MiB = "MiB"
|
||||
GiB = "GiB"
|
||||
TiB = "TiB"
|
||||
|
||||
class Metadata(BaseXmlModel, search_mode='ordered'):
|
||||
# wrapped("metadata", element(default=None, ns="deevirt", nsmap={'deevirt': 'https://deevirt.com/'}))
|
||||
@@ -613,7 +627,7 @@ class Devices(BaseXmlModel, search_mode='ordered'):
|
||||
watchdog:Optional[Watchdog] = element(default=None)
|
||||
tpm:Optional[TPM] = element(default=None)
|
||||
|
||||
class VM(BaseXmlModel, tag='domain', search_mode='ordered'):
|
||||
class Dom(BaseXmlModel, tag='domain', search_mode='ordered'):
|
||||
class on_poweroffEnum(str, Enum):
|
||||
destroy = "destroy"
|
||||
restart = "restart"
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
from enum import Enum
|
||||
|
||||
class YesNoEnum(str, Enum):
|
||||
YES = "yes"
|
||||
NO = "no"
|
||||
|
||||
class OnOffEnum(str, Enum):
|
||||
ON = "on"
|
||||
OFF = "off"
|
||||
|
||||
class UnitEnum(str, Enum):
|
||||
KiB = "KiB"
|
||||
MiB = "MiB"
|
||||
GiB = "GiB"
|
||||
TiB = "TiB"
|
||||
Reference in New Issue
Block a user