diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-04-24 02:30:31 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-04-24 02:30:31 +0000 |
commit | aef42921437ebc85357e378e87706141303405d3 (patch) | |
tree | 53e5abef25591897a81c45b8070b2c8689b294fa /src/lib/Server/Plugins/SGenshi.py | |
parent | 63ecef1656352ac0ab02290e89830e259914f279 (diff) | |
download | bcfg2-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.py | 3 |
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') |