summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-21 17:21:42 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-21 17:21:42 -0400
commite436085271fc494bdfeaa66c42ab2b50ec783bec (patch)
treee372313a6c7f5a98d57c0c8239c501e1e6a9e8ff /src
parentb08bf90dff32de73521c74a68968ef6525b72360 (diff)
downloadbcfg2-e436085271fc494bdfeaa66c42ab2b50ec783bec.tar.gz
bcfg2-e436085271fc494bdfeaa66c42ab2b50ec783bec.tar.bz2
bcfg2-e436085271fc494bdfeaa66c42ab2b50ec783bec.zip
fixed xml stringification in core, bcfg2
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Server/Core.py6
-rwxr-xr-xsrc/sbin/bcfg24
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index af28dd0a6..d518e0e92 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -553,7 +553,8 @@ class BaseCore(object):
for plugin in self.plugins_by_type(Bcfg2.Server.Plugin.Probing):
for probe in plugin.GetProbes(metadata):
resp.append(probe)
- return lxml.etree.tostring(resp, encoding='unicode')
+ return lxml.etree.tostring(resp,
+ xml_declaration=False).decode('UTF-8')
except:
err = sys.exc_info()[1]
self.critical_error("Error determining probes for %s: %s" %
@@ -607,7 +608,8 @@ class BaseCore(object):
client = self.resolve_client(address)[0]
try:
config = self.BuildConfiguration(client)
- return lxml.etree.tostring(config, encoding='unicode')
+ return lxml.etree.tostring(config,
+ xml_declaration=False).decode('UTF-8')
except Bcfg2.Server.Plugin.MetadataConsistencyError:
self.critical_error("Metadata consistency failure for %s" % client)
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2
index b3b20eb78..3fbeb0a62 100755
--- a/src/sbin/bcfg2
+++ b/src/sbin/bcfg2
@@ -214,7 +214,7 @@ class Client:
try:
# upload probe responses
proxy.RecvProbeData(Bcfg2.Client.XML.tostring(probedata,
- encoding='unicode'))
+ xml_declaration=False).decode('UTF-8'))
except Bcfg2.Proxy.ProxyError:
err = sys.exc_info()[1]
self.logger.error("Failed to upload probe data: %s" % err)
@@ -313,7 +313,7 @@ class Client:
try:
proxy.RecvStats(Bcfg2.Client.XML.tostring(feedback,
- encoding='unicode'))
+ xml_declaration=False).decode('UTF-8'))
except Bcfg2.Proxy.ProxyError:
err = sys.exc_info()[1]
self.logger.error("Failed to upload configuration statistics: "