mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-12-23 17:34:21 +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
|
||||
|
||||
|
||||
XMLBuilder.register_namespace(
|
||||
"qemu", "http://libvirt.org/schemas/domain/qemu/1.0")
|
||||
|
||||
|
||||
class _XMLNSQemuArg(XMLBuilder):
|
||||
XML_NAME = "qemu:arg"
|
||||
|
||||
|
@ -76,9 +76,10 @@ class _XPath(object):
|
||||
|
||||
|
||||
class _XMLBase(object):
|
||||
NAMESPACES = {
|
||||
"qemu": "http://libvirt.org/schemas/domain/qemu/1.0",
|
||||
}
|
||||
NAMESPACES = {}
|
||||
@classmethod
|
||||
def register_namespace(cls, nsname, uri):
|
||||
cls.NAMESPACES[nsname] = uri
|
||||
|
||||
def copy_api(self):
|
||||
raise NotImplementedError()
|
||||
|
@ -419,6 +419,11 @@ class XMLBuilder(object):
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1184131
|
||||
_XML_SANITIZE = False
|
||||
|
||||
@staticmethod
|
||||
def register_namespace(nsname, uri):
|
||||
XMLAPI.register_namespace(nsname, uri)
|
||||
|
||||
|
||||
def __init__(self, conn, parsexml=None,
|
||||
parentxmlstate=None, relative_object_xpath=None):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user