summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-21 13:32:51 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-21 13:33:20 -0400
commit22016ee593d6047855964734a17120d2aea6b5a5 (patch)
tree92adbca098e89295d4217561ee53454134b781a2 /src/sbin
parentd6bf20100848dc61b971844e21d24da44b9f65f7 (diff)
downloadbcfg2-22016ee593d6047855964734a17120d2aea6b5a5.tar.gz
bcfg2-22016ee593d6047855964734a17120d2aea6b5a5.tar.bz2
bcfg2-22016ee593d6047855964734a17120d2aea6b5a5.zip
lots of various py3k fixes
Diffstat (limited to 'src/sbin')
-rwxr-xr-xsrc/sbin/bcfg2-build-reports6
-rwxr-xr-xsrc/sbin/bcfg2-crypt2
-rwxr-xr-xsrc/sbin/bcfg2-info3
3 files changed, 5 insertions, 6 deletions
diff --git a/src/sbin/bcfg2-build-reports b/src/sbin/bcfg2-build-reports
index 7fa08110a..e49446385 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='UTF-8', xml_declaration=True)
+ tree = tostring(rssdata, encoding='unicode')
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='UTF-8', xml_declaration=True), deliv)
+ fileout(tostring(ElementTree(procnodereport).getroot(), encoding='unicode'), 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='UTF-8', xml_declaration=True)
+ outputstring = tostring(stylesheet.apply(ElementTree(procnodereport)).getroot(), encoding='unicode')
if deliverymechanism == 'rss':
rss(outputstring, deliv, reprt)
else: # Must be deliverymechanism == 'www':
diff --git a/src/sbin/bcfg2-crypt b/src/sbin/bcfg2-crypt
index 79f9e26a2..9da4a25d1 100755
--- a/src/sbin/bcfg2-crypt
+++ b/src/sbin/bcfg2-crypt
@@ -255,7 +255,7 @@ class PropertiesEncryptor(Encryptor):
while xdata.getparent() != None:
xdata = xdata.getparent()
xdata.set("encryption", "true")
- return lxml.etree.tostring(xdata)
+ return lxml.etree.tostring(xdata, encoding='unicode')
def _get_passphrase(self, chunk):
pname = chunk.get("encrypted") or chunk.get("encryption")
diff --git a/src/sbin/bcfg2-info b/src/sbin/bcfg2-info
index 7e8558855..3f7f33344 100755
--- a/src/sbin/bcfg2-info
+++ b/src/sbin/bcfg2-info
@@ -395,8 +395,7 @@ class infoCore(cmd.Cmd, Bcfg2.Server.Core.BaseCore):
try:
metadata = self.build_metadata(client)
self.Bind(entry, metadata)
- data = lxml.etree.tostring(entry, encoding="UTF-8",
- xml_declaration=True)
+ data = lxml.etree.tostring(entry, encoding="unicode")
if outfile:
open(outfile, 'w').write(data)
else: