summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/FileProbes.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-22 10:00:38 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-22 10:00:38 -0400
commitd59c274547b6aecb3bcbfb99d1b874d403c51bea (patch)
tree7d83406c21f1825a7ec24675f2b6f86123a62da0 /src/lib/Bcfg2/Server/Plugins/FileProbes.py
parent2c86f67fa234406ee0007a3f77cc1aa9f45ed746 (diff)
downloadbcfg2-d59c274547b6aecb3bcbfb99d1b874d403c51bea.tar.gz
bcfg2-d59c274547b6aecb3bcbfb99d1b874d403c51bea.tar.bz2
bcfg2-d59c274547b6aecb3bcbfb99d1b874d403c51bea.zip
fixed lxml.etree.tostring invocations
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/FileProbes.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/FileProbes.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/FileProbes.py b/src/lib/Bcfg2/Server/Plugins/FileProbes.py
index a48524ac9..632d586e8 100644
--- a/src/lib/Bcfg2/Server/Plugins/FileProbes.py
+++ b/src/lib/Bcfg2/Server/Plugins/FileProbes.py
@@ -34,7 +34,7 @@ data = lxml.etree.Element("ProbedFileData",
group=grp.getgrgid(stat[5])[0],
perms=oct(stat[0] & 07777))
data.text = b64encode(open(path).read())
-print(lxml.etree.tostring(data, encoding="unicode"))
+print(lxml.etree.tostring(data, xml_declaration=False).decode('UTF-8'))
"""
class FileProbes(Bcfg2.Server.Plugin.Plugin,
@@ -214,9 +214,10 @@ class FileProbes(Bcfg2.Server.Plugin.Plugin,
root = lxml.etree.Element("FileInfo")
root.append(info)
try:
- open(infoxml, "w").write(lxml.etree.tostring(root,
- encoding='unicode',
- pretty_print=True))
+ open(infoxml,
+ "w").write(lxml.etree.tostring(root,
+ xml_declaration=False,
+ pretty_print=True).decode('UTF-8'))
except IOError:
err = sys.exc_info()[1]
self.logger.error("Could not write %s: %s" % (fileloc, err))