Subject: xmlbuilder: Log broken XML if we can't parse it From: Cole Robinson crobinso@redhat.com Tue Feb 25 12:45:15 2014 -0500 Date: Tue Feb 25 12:45:15 2014 -0500: Git: 87c2ff1a14f3a78648c8a17cfa72e83098763ec8 Related to https://bugzilla.redhat.com/show_bug.cgi?id=1066564 diff --git a/virtinst/xmlbuilder.py b/virtinst/xmlbuilder.py index d46738c..328f6f2 100644 --- a/virtinst/xmlbuilder.py +++ b/virtinst/xmlbuilder.py @@ -20,6 +20,7 @@ # MA 02110-1301 USA. import copy +import logging import os import re @@ -686,7 +686,13 @@ class _XMLState(object): else: if not xml: xml = self.make_xml_stub() - doc = libxml2.parseDoc(xml) + + try: + doc = libxml2.parseDoc(xml) + except: + logging.debug("Error parsing xml=\n%s", xml) + raise + self.xml_root_doc = _DocCleanupWrapper(doc) self.xml_node = doc.children self.xml_node.virtinst_is_build = self.is_build