diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-08-21 13:32:51 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-08-21 13:33:20 -0400 |
commit | 22016ee593d6047855964734a17120d2aea6b5a5 (patch) | |
tree | 92adbca098e89295d4217561ee53454134b781a2 /src/lib/Bcfg2/Server/Plugins/TCheetah.py | |
parent | d6bf20100848dc61b971844e21d24da44b9f65f7 (diff) | |
download | bcfg2-22016ee593d6047855964734a17120d2aea6b5a5.tar.gz bcfg2-22016ee593d6047855964734a17120d2aea6b5a5.tar.bz2 bcfg2-22016ee593d6047855964734a17120d2aea6b5a5.zip |
lots of various py3k fixes
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/TCheetah.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/TCheetah.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/TCheetah.py b/src/lib/Bcfg2/Server/Plugins/TCheetah.py index d99baa512..2bf475363 100644 --- a/src/lib/Bcfg2/Server/Plugins/TCheetah.py +++ b/src/lib/Bcfg2/Server/Plugins/TCheetah.py @@ -1,13 +1,11 @@ '''This module implements a templating generator based on Cheetah''' -import binascii import logging import sys import traceback import Bcfg2.Server.Plugin -# py3k compatibility -if sys.hexversion >= 0x03000000: - unicode = str + +from Bcfg2.Bcfg2Py3k import unicode, b64encode logger = logging.getLogger('Bcfg2.Plugins.TCheetah') @@ -60,7 +58,7 @@ class TemplateFile: else: if entry.get('encoding') == 'base64': # take care of case where file needs base64 encoding - entry.text = binascii.b2a_base64(self.template) + entry.text = b64encode(self.template) else: entry.text = unicode(str(self.template), self.encoding) except: |