diff options
author | Holger Weiß <holger@zedat.fu-berlin.de> | 2011-04-13 15:16:06 +0200 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-06-14 12:36:44 -0500 |
commit | c7f6cb353df45bb3662b78a49815a6b1a54a7f88 (patch) | |
tree | 9bd13a202328df8b62172d3759ba486dc122657f | |
parent | 071ef1a1fbe6368b1abb81855e1ab95e316e6911 (diff) | |
download | bcfg2-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.
-rw-r--r-- | src/lib/Server/Plugins/Cfg.py | 5 |
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: |