mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
xmlapi: Move namespace mappings to the relevant classes
So we don't need to update xmlapi.py to account for additions
This commit is contained in:
parent
6063538750
commit
841d5126d2
@ -7,6 +7,10 @@
|
|||||||
from ..xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
|
from ..xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
|
||||||
|
|
||||||
|
|
||||||
|
XMLBuilder.register_namespace(
|
||||||
|
"qemu", "http://libvirt.org/schemas/domain/qemu/1.0")
|
||||||
|
|
||||||
|
|
||||||
class _XMLNSQemuArg(XMLBuilder):
|
class _XMLNSQemuArg(XMLBuilder):
|
||||||
XML_NAME = "qemu:arg"
|
XML_NAME = "qemu:arg"
|
||||||
|
|
||||||
|
@ -76,9 +76,10 @@ class _XPath(object):
|
|||||||
|
|
||||||
|
|
||||||
class _XMLBase(object):
|
class _XMLBase(object):
|
||||||
NAMESPACES = {
|
NAMESPACES = {}
|
||||||
"qemu": "http://libvirt.org/schemas/domain/qemu/1.0",
|
@classmethod
|
||||||
}
|
def register_namespace(cls, nsname, uri):
|
||||||
|
cls.NAMESPACES[nsname] = uri
|
||||||
|
|
||||||
def copy_api(self):
|
def copy_api(self):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
@ -419,6 +419,11 @@ class XMLBuilder(object):
|
|||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1184131
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1184131
|
||||||
_XML_SANITIZE = False
|
_XML_SANITIZE = False
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def register_namespace(nsname, uri):
|
||||||
|
XMLAPI.register_namespace(nsname, uri)
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, conn, parsexml=None,
|
def __init__(self, conn, parsexml=None,
|
||||||
parentxmlstate=None, relative_object_xpath=None):
|
parentxmlstate=None, relative_object_xpath=None):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user