summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-09-22 22:17:15 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-09-22 22:17:15 +0000
commitc2353e78958419abcc490b619e2f11f450984318 (patch)
tree8cd0ccf6768ae4ffff493298f1a623954ab8655e /src
parentc97ed92127b9d964d0514ae1c33af298f1d0f2e1 (diff)
downloadbcfg2-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
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/TGenshi.py10
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: