summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/SGenshi.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2009-04-24 02:30:31 +0000
committerNarayan Desai <desai@mcs.anl.gov>2009-04-24 02:30:31 +0000
commitaef42921437ebc85357e378e87706141303405d3 (patch)
tree53e5abef25591897a81c45b8070b2c8689b294fa /src/lib/Server/Plugins/SGenshi.py
parent63ecef1656352ac0ab02290e89830e259914f279 (diff)
downloadbcfg2-aef42921437ebc85357e378e87706141303405d3.tar.gz
bcfg2-aef42921437ebc85357e378e87706141303405d3.tar.bz2
bcfg2-aef42921437ebc85357e378e87706141303405d3.zip
SGenshi: improve error handling
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5176 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/SGenshi.py')
-rw-r--r--src/lib/Server/Plugins/SGenshi.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/Server/Plugins/SGenshi.py b/src/lib/Server/Plugins/SGenshi.py
index 93dc15e7b..4f3490dac 100644
--- a/src/lib/Server/Plugins/SGenshi.py
+++ b/src/lib/Server/Plugins/SGenshi.py
@@ -9,6 +9,9 @@ logger = logging.getLogger('Bcfg2.Plugins.SGenshi')
class SGenshiTemplateFile(Bcfg2.Server.Plugins.TGenshi.TemplateFile):
def get_xml_value(self, metadata):
+ if not hasattr(self, 'template'):
+ logger.error("No parsed template information for %s" % (self.name))
+ raise Bcfg2.Server.Plugin.PluginExecutionError
stream = self.template.generate(metadata=metadata,).filter( \
Bcfg2.Server.Plugins.TGenshi.removecomment)
data = stream.render('xml')