summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2011-01-23 10:25:07 -0600
committerTim Laszlo <tim.laszlo@gmail.com>2011-01-23 10:25:07 -0600
commit5d60f0837cbc9f7edd39145a47f15efc2bae6810 (patch)
treea56f0d483df1321099ffed740fc7e96285b726b5 /src/lib
parentf1211314f5d9a8fcf3702ddef4413edfc474f9fb (diff)
downloadbcfg2-5d60f0837cbc9f7edd39145a47f15efc2bae6810.tar.gz
bcfg2-5d60f0837cbc9f7edd39145a47f15efc2bae6810.tar.bz2
bcfg2-5d60f0837cbc9f7edd39145a47f15efc2bae6810.zip
TGenshi: Handle empty files (Resolves #948)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugins/TGenshi.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/TGenshi.py b/src/lib/Server/Plugins/TGenshi.py
index 29e6d7307..2a12672cc 100644
--- a/src/lib/Server/Plugins/TGenshi.py
+++ b/src/lib/Server/Plugins/TGenshi.py
@@ -105,6 +105,8 @@ class TemplateFile:
entry.text = xmldata
else:
entry.text = unicode(xmldata, self.encoding)
+ if entry.text == '':
+ entry.set('empty', 'true')
except TemplateError, terror:
logger.error('Genshi template error: %s' % terror)
raise Bcfg2.Server.Plugin.PluginExecutionError