mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-26 10:03:54 +03:00
bad5eabd93
From the libosinfo discussion here: https://www.redhat.com/archives/libosinfo/2018-September/msg00003.html This is a cross-app schema for tracking libosinfo OS ID in the domain <metadata> XML. Example: <metadata> <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> <libosinfo:os id="http://fedoraproject.org/fedora/17"/> </libosinfo:libosinfo> </metadata>
27 lines
653 B
Python
27 lines
653 B
Python
# Copyright 2017 Red Hat, Inc.
|
|
# Cole Robinson <crobinso@redhat.com>
|
|
#
|
|
# This work is licensed under the GNU GPLv2 or later.
|
|
# See the COPYING file in the top-level directory.
|
|
|
|
from ..xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
|
|
|
|
|
|
XMLBuilder.register_namespace(
|
|
"libosinfo", "http://libosinfo.org/xmlns/libvirt/domain/1.0")
|
|
|
|
|
|
class _XMLNSLibosinfo(XMLBuilder):
|
|
XML_NAME = "libosinfo:libosinfo"
|
|
|
|
os_id = XMLProperty("./libosinfo:os/@id")
|
|
|
|
|
|
class DomainMetadata(XMLBuilder):
|
|
"""
|
|
Class for generating <metadata> XML
|
|
"""
|
|
XML_NAME = "metadata"
|
|
|
|
libosinfo = XMLChildProperty(_XMLNSLibosinfo, is_single=True)
|