diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Server/Metadata.py | 4 | ||||
-rw-r--r-- | src/lib/Server/Plugin.py | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/Server/Metadata.py b/src/lib/Server/Metadata.py index 957179751..47bbb3ecb 100644 --- a/src/lib/Server/Metadata.py +++ b/src/lib/Server/Metadata.py @@ -1,7 +1,7 @@ '''This file stores persistent metadata for the BCFG Configuration Repository''' __revision__ = '$Revision$' -from lxml.etree import XML, SubElement, Element +from lxml.etree import XML, SubElement, Element, _Comment, tostring from syslog import syslog, LOG_ERR, LOG_INFO from Bcfg2.Server.Plugin import SingleXMLFileBacked @@ -106,6 +106,8 @@ class MetadataStore(SingleXMLFileBacked): def pretty_print(self, element, level=0): '''Produce a pretty-printed text representation of element''' + if isinstance(element, _Comment): + return (level * " ") + tostring(element) if element.text: fmt = "%s<%%s %%s>%%s</%%s>" % (level*" ") data = (element.tag, (" ".join(["%s='%s'" % (key, element.attrib[key]) for key in element.attrib])), diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index 7139d21ab..262d6092d 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -194,7 +194,7 @@ class ScopedXMLFile(SingleXMLFileBacked): xdata = XML(self.data) except XMLSyntaxError, msg: syslog(LOG_ERR, "Failed to parse %s"%(self.name)) - syslog(LOG_ERR, msg) + # need to add in lxml error messages, once they are supported return self.store = {} for entry in [ent for ent in xdata.getchildren() if not isinstance(ent, _Comment)]: |