mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-12 20:58:28 +03:00
util: Catch libxml2 stderr messages
Similar to what we do with libvirt. Was never really relevant before, but some of the namespace XML stuff can be a bit noisy even though it doesn't have any functional impact that I can tell
This commit is contained in:
parent
38c10f70f8
commit
e7e9369989
@ -17,9 +17,6 @@
|
|||||||
|
|
||||||
import difflib
|
import difflib
|
||||||
import os
|
import os
|
||||||
import logging
|
|
||||||
|
|
||||||
import libvirt
|
|
||||||
|
|
||||||
import virtinst
|
import virtinst
|
||||||
import virtinst.cli
|
import virtinst.cli
|
||||||
@ -143,11 +140,6 @@ def open_test_remote():
|
|||||||
return openconn(uri_test_remote)
|
return openconn(uri_test_remote)
|
||||||
|
|
||||||
|
|
||||||
def _libvirt_callback(ignore, err):
|
|
||||||
logging.warn("libvirt errmsg: %s", err[2])
|
|
||||||
libvirt.registerErrorHandler(f=_libvirt_callback, ctx=None)
|
|
||||||
|
|
||||||
|
|
||||||
def test_create(testconn, xml, define_func="defineXML"):
|
def test_create(testconn, xml, define_func="defineXML"):
|
||||||
xml = virtinst.uri.sanitize_xml_for_test_define(xml)
|
xml = virtinst.uri.sanitize_xml_for_test_define(xml)
|
||||||
|
|
||||||
|
@ -324,7 +324,12 @@ def register_libvirt_error_handler():
|
|||||||
def libvirt_callback(userdata, err):
|
def libvirt_callback(userdata, err):
|
||||||
ignore = userdata
|
ignore = userdata
|
||||||
ignore = err
|
ignore = err
|
||||||
|
def libxml2_callback(userdata, err):
|
||||||
|
ignore = userdata
|
||||||
|
logging.debug("libxml2 callback error: %s", err)
|
||||||
libvirt.registerErrorHandler(f=libvirt_callback, ctx=None)
|
libvirt.registerErrorHandler(f=libvirt_callback, ctx=None)
|
||||||
|
import libxml2
|
||||||
|
libxml2.registerErrorHandler(f=libxml2_callback, ctx=None)
|
||||||
|
|
||||||
|
|
||||||
def ensure_meter(meter):
|
def ensure_meter(meter):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user