mirror of
https://github.com/openbsd/ports.git
synced 2026-06-18 07:24:23 +02:00
6cc819c94a
anymore. Cherry-pick commits from git master branch to use xmletree.py backend. OK aja
29 lines
1.1 KiB
Plaintext
29 lines
1.1 KiB
Plaintext
From 766bf2ecdc5ac6853b41a36412d09c1950c700bf Mon Sep 17 00:00:00 2001
|
|
From: Cole Robinson <crobinso@redhat.com>
|
|
Date: Wed, 17 Sep 2025 10:42:15 -0400
|
|
Subject: [PATCH] xmlapi: add xmletree.py backend
|
|
|
|
This is an XMLAPI backend using stock python ElementTree.
|
|
We need to extend and re-implement some of ElementTree internals
|
|
to make its output match what libvirt generates, so virt-xml edits
|
|
don't generate extraneous diffs.
|
|
|
|
This is disabled by default but will be used if libxml2 is not
|
|
installed. You can explicitly opt in to using it by setting
|
|
env var VIRTINST_XML_BACKEND=etree before virtinst is imported
|
|
|
|
Signed-off-by: Cole Robinson <crobinso@redhat.com>
|
|
|
|
Index: tests/test_xmlparse.py
|
|
--- tests/test_xmlparse.py.orig
|
|
+++ tests/test_xmlparse.py
|
|
@@ -1008,7 +1008,7 @@ def testXMLBuilderCoverage():
|
|
# Ensure we validate root element
|
|
virtinst.DeviceDisk(conn, parsexml="<foo/>")
|
|
|
|
- with pytest.raises(Exception, match=".*xmlParseDoc.*"):
|
|
+ with pytest.raises(Exception, match=".*(xmlParseDoc|not 'int').*"):
|
|
# Ensure we validate root element
|
|
virtinst.DeviceDisk(conn, parsexml=-1)
|
|
|