summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorHolger Weiß <holger@zedat.fu-berlin.de>2011-04-13 15:16:06 +0200
committerSol Jerome <sol.jerome@gmail.com>2011-06-14 12:36:44 -0500
commitc7f6cb353df45bb3662b78a49815a6b1a54a7f88 (patch)
tree9bd13a202328df8b62172d3759ba486dc122657f /src/lib
parent071ef1a1fbe6368b1abb81855e1ab95e316e6911 (diff)
downloadbcfg2-c7f6cb353df45bb3662b78a49815a6b1a54a7f88.tar.gz
bcfg2-c7f6cb353df45bb3662b78a49815a6b1a54a7f88.tar.bz2
bcfg2-c7f6cb353df45bb3662b78a49815a6b1a54a7f88.zip
Cfg: Fix the output encoding of Genshi templates
Encode the configuration files generated from Genshi templates according to the encoding setting from Options.py instead of unconditionally using UTF-8.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/Cfg.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/Cfg.py b/src/lib/Server/Plugins/Cfg.py
index 41cf6c9c1..a97cbd550 100644
--- a/src/lib/Server/Plugins/Cfg.py
+++ b/src/lib/Server/Plugins/Cfg.py
@@ -134,9 +134,10 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet):
metadata=metadata,
path=basefile.name).filter(removecomment)
try:
- data = stream.render('text', strip_whitespace=False)
+ data = stream.render('text', encoding=self.encoding,
+ strip_whitespace=False)
except TypeError:
- data = stream.render('text')
+ data = stream.render('text', encoding=self.encoding)
if data == '':
entry.set('empty', 'true')
except Exception: