summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-server
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-06-30 15:59:01 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-06-30 15:59:01 +0000
commite32bbfbca5233d4ad7a5bee74698d614ff0b1f24 (patch)
tree5f6b08da35732532f2b3d8761bd7f26a61ce8aab /src/sbin/bcfg2-server
parent477603f8f0680f40781559ec1cee8f85c2d76913 (diff)
downloadbcfg2-e32bbfbca5233d4ad7a5bee74698d614ff0b1f24.tar.gz
bcfg2-e32bbfbca5233d4ad7a5bee74698d614ff0b1f24.tar.bz2
bcfg2-e32bbfbca5233d4ad7a5bee74698d614ff0b1f24.zip
Unicode support (from stousignant) (Resolves Ticket #549)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4731 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin/bcfg2-server')
-rwxr-xr-xsrc/sbin/bcfg2-server8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index a5c5310ba..d26fce9bf 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -41,7 +41,8 @@ class Bcfg2Serv(Bcfg2.Component.Component):
try:
self.Core = Core(setup['repo'], setup['structures'],
- setup['generators'], setup['password'], setup['svn'])
+ setup['generators'], setup['password'],
+ setup['svn'], setup['encoding'])
except CoreInitError, msg:
logger.critical("Fatal error: %s" % (msg))
raise SystemExit, 1
@@ -104,7 +105,7 @@ class Bcfg2Serv(Bcfg2.Component.Component):
if isinstance(p, Bcfg2.Server.Plugin.ProbingPlugin)]:
for probe in plugin.GetProbes(meta):
resp.append(probe)
- return tostring(resp)
+ return tostring(resp, encoding='UTF-8', xml_declaration=True)
except Bcfg2.Server.Plugins.Metadata.MetadataConsistencyError:
warning = 'Client metadata resolution error for %s; check server log' % address[0]
self.logger.warning(warning)
@@ -158,7 +159,7 @@ class Bcfg2Serv(Bcfg2.Component.Component):
'''Build config for a client'''
try:
client = self.Core.metadata.resolve_client(address)
- return tostring(self.Core.BuildConfiguration(client))
+ return tostring(self.Core.BuildConfiguration(client), encoding='UTF-8', xml_declaration=True)
except Bcfg2.Server.Plugins.Metadata.MetadataConsistencyError:
self.logger.warning("Metadata consistency failure for %s" % (address))
raise Fault, (6, "Metadata consistency failure")
@@ -201,6 +202,7 @@ if __name__ == '__main__':
'location' : Bcfg2.Options.SERVER_LOCATION,
'passwd' : Bcfg2.Options.SERVER_PASSWORD,
'static' : Bcfg2.Options.SERVER_STATIC,
+ 'encoding' : Bcfg2.Options.ENCODING,
})