diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-09-22 22:17:15 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-09-22 22:17:15 +0000 |
commit | c2353e78958419abcc490b619e2f11f450984318 (patch) | |
tree | 8cd0ccf6768ae4ffff493298f1a623954ab8655e | |
parent | c97ed92127b9d964d0514ae1c33af298f1d0f2e1 (diff) | |
download | bcfg2-c2353e78958419abcc490b619e2f11f450984318.tar.gz bcfg2-c2353e78958419abcc490b619e2f11f450984318.tar.bz2 bcfg2-c2353e78958419abcc490b619e2f11f450984318.zip |
TGenshi: Ensure backward/forward api compatibility for genshi
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5448 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r-- | src/lib/Server/Plugins/TGenshi.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/TGenshi.py b/src/lib/Server/Plugins/TGenshi.py index 0d56f0189..4bec8b2f1 100644 --- a/src/lib/Server/Plugins/TGenshi.py +++ b/src/lib/Server/Plugins/TGenshi.py @@ -72,13 +72,19 @@ class TemplateFile: else: ttypes = [TextTemplate] if True in [isinstance(self.template, t) for t in ttypes]: - textdata = stream.render('text', strip_whitespace=False) + try: + textdata = stream.render('text', strip_whitespace=False) + except TypeError: + textdata = stream.render('text') if type(textdata) == unicode: entry.text = textdata else: entry.text = unicode(textdata, self.encoding) else: - xmldata = stream.render('xml', strip_whitespace=False) + try: + xmldata = stream.render('xml', strip_whitespace=False) + except TypeError: + xmldata = stream.render('xml') if type(xmldata) == unicode: entry.text = xmldata else: |