summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-build-reports
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-06-30 15:59:01 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-06-30 15:59:01 +0000
commite32bbfbca5233d4ad7a5bee74698d614ff0b1f24 (patch)
tree5f6b08da35732532f2b3d8761bd7f26a61ce8aab /src/sbin/bcfg2-build-reports
parent477603f8f0680f40781559ec1cee8f85c2d76913 (diff)
downloadbcfg2-e32bbfbca5233d4ad7a5bee74698d614ff0b1f24.tar.gz
bcfg2-e32bbfbca5233d4ad7a5bee74698d614ff0b1f24.tar.bz2
bcfg2-e32bbfbca5233d4ad7a5bee74698d614ff0b1f24.zip
Unicode support (from stousignant) (Resolves Ticket #549)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4731 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-build-reports')
-rwxr-xr-xsrc/sbin/bcfg2-build-reports6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sbin/bcfg2-build-reports b/src/sbin/bcfg2-build-reports
index 534cbdd91..8ae8475a3 100755
--- a/src/sbin/bcfg2-build-reports
+++ b/src/sbin/bcfg2-build-reports
@@ -100,7 +100,7 @@ def rss(reportxml, delivery, report):
for item in items:
channel.append(item)
- tree = "<?xml version=\"1.0\"?>" + tostring(rssdata)
+ tree = tostring(rssdata, encoding='UTF-8', xml_declaration=True)
fil.write(tree)
fil.close()
@@ -249,7 +249,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()), deliv)
+ fileout(tostring(ElementTree(procnodereport).getroot(), encoding='UTF-8', xml_declaration=True), deliv)
break
transform = delivtype + '-' + deliverymechanism + '.xsl'
@@ -301,7 +301,7 @@ if __name__ == '__main__':
(toastring, socket.getfqdn(), outputstring)
mail(outputstring, c) #call function to send
else:
- outputstring = tostring(stylesheet.apply(ElementTree(procnodereport)).getroot())
+ outputstring = tostring(stylesheet.apply(ElementTree(procnodereport)).getroot(), encoding='UTF-8', xml_declaration=True)
if deliverymechanism == 'rss':
rss(outputstring, deliv, reprt)
else: # must be deliverymechanism == 'www':