summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Server/Core.py4
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Metadata.py3
-rwxr-xr-xsrc/sbin/bcfg28
3 files changed, 7 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index 377932614..43f2ce68c 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -554,7 +554,7 @@ class BaseCore(object):
for probe in plugin.GetProbes(metadata):
resp.append(probe)
return lxml.etree.tostring(resp, encoding='UTF-8',
- xml_declaration=True)
+ xml_declaration=False)
except:
err = sys.exc_info()[1]
self.critical_error("Error determining probes for %s: %s" %
@@ -609,7 +609,7 @@ class BaseCore(object):
try:
config = self.BuildConfiguration(client)
return lxml.etree.tostring(config, encoding='UTF-8',
- xml_declaration=True)
+ xml_declaration=False)
except Bcfg2.Server.Plugin.MetadataConsistencyError:
self.critical_error("Metadata consistency failure for %s" % client)
diff --git a/src/lib/Bcfg2/Server/Plugins/Metadata.py b/src/lib/Bcfg2/Server/Plugins/Metadata.py
index 6be189cfd..3aee43543 100644
--- a/src/lib/Bcfg2/Server/Plugins/Metadata.py
+++ b/src/lib/Bcfg2/Server/Plugins/Metadata.py
@@ -151,7 +151,8 @@ class XMLMetadataConfig(Bcfg2.Server.Plugin.XMLFileBacked):
raise Bcfg2.Server.Plugin.MetadataRuntimeError(msg)
# prep data
dataroot = xmltree.getroot()
- newcontents = lxml.etree.tostring(dataroot, pretty_print=True)
+ newcontents = str(lxml.etree.tostring(dataroot, pretty_print=True,
+ encoding='unicode'))
fd = datafile.fileno()
while locked(fd) == True:
diff --git a/src/sbin/bcfg2 b/src/sbin/bcfg2
index ff5644cc1..d757ca08a 100755
--- a/src/sbin/bcfg2
+++ b/src/sbin/bcfg2
@@ -190,7 +190,7 @@ class Client:
times['probe_download'] = time.time()
try:
- probes = Bcfg2.Client.XML.XML(probe_data)
+ probes = Bcfg2.Client.XML.XML(str(probe_data))
except Bcfg2.Client.XML.ParseError:
syntax_error = sys.exc_info()[1]
self.fatal_error(
@@ -211,8 +211,7 @@ class Client:
try:
# upload probe responses
proxy.RecvProbeData(Bcfg2.Client.XML.tostring(probedata,
- encoding='UTF-8',
- xml_declaration=True))
+ encoding='unicode'))
except Bcfg2.Proxy.ProxyError:
err = sys.exc_info()[1]
self.logger.error("Failed to upload probe data: %s" % err)
@@ -311,8 +310,7 @@ class Client:
try:
proxy.RecvStats(Bcfg2.Client.XML.tostring(feedback,
- encoding='UTF-8',
- xml_declaration=True))
+ encoding='unicode'))
except Bcfg2.Proxy.ProxyError:
err = sys.exc_info()[1]
self.logger.error("Failed to upload configuration statistics: "