From d59c274547b6aecb3bcbfb99d1b874d403c51bea Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 22 Aug 2012 10:00:38 -0400 Subject: fixed lxml.etree.tostring invocations --- src/sbin/bcfg2-build-reports | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sbin/bcfg2-build-reports') diff --git a/src/sbin/bcfg2-build-reports b/src/sbin/bcfg2-build-reports index e49446385..318e9de5d 100755 --- a/src/sbin/bcfg2-build-reports +++ b/src/sbin/bcfg2-build-reports @@ -110,7 +110,7 @@ def rss(reportxml, delivery, report): for item in items: channel.append(item) - tree = tostring(rssdata, encoding='unicode') + tree = tostring(rssdata, xml_declaration=False).decode('UTF-8') fil.write(tree) fil.close() @@ -260,7 +260,7 @@ if __name__ == '__main__': # Apply XSLT, different ones based on report type, and options if deliverymechanism == 'null-operator': # Special Cases - fileout(tostring(ElementTree(procnodereport).getroot(), encoding='unicode'), deliv) + fileout(tostring(ElementTree(procnodereport).getroot(), xml_declaration=False).decode('UTF-8'), deliv) break transform = delivtype + '-' + deliverymechanism + '.xsl' @@ -312,7 +312,7 @@ if __name__ == '__main__': (toastring, socket.getfqdn(), outputstring) mail(outputstring, c) #call function to send else: - outputstring = tostring(stylesheet.apply(ElementTree(procnodereport)).getroot(), encoding='unicode') + outputstring = tostring(stylesheet.apply(ElementTree(procnodereport)).getroot(), xml_declaration=False).decode('UTF-8') if deliverymechanism == 'rss': rss(outputstring, deliv, reprt) else: # Must be deliverymechanism == 'www': -- cgit v1.2.3-1-g7c22