From e436085271fc494bdfeaa66c42ab2b50ec783bec Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 21 Aug 2012 17:21:42 -0400 Subject: fixed xml stringification in core, bcfg2 --- src/lib/Bcfg2/Server/Core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib/Bcfg2/Server/Core.py') 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) -- cgit v1.2.3-1-g7c22