diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Server/Plugins/TCheetah.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/TCheetah.py b/src/lib/Server/Plugins/TCheetah.py index 9065b5ceb..ab87d24d5 100644 --- a/src/lib/Server/Plugins/TCheetah.py +++ b/src/lib/Server/Plugins/TCheetah.py @@ -1,12 +1,14 @@ '''This module implements a templating generator based on Cheetah''' __revision__ = '$Revision$' -import Cheetah.Template, Cheetah.Parser -import logging, sys, traceback +import logging +import sys +import traceback import Bcfg2.Server.Plugin logger = logging.getLogger('Bcfg2.Plugins.TCheetah') + class TemplateFile: '''Template file creates Cheetah template structures for the loaded file''' def __init__(self, name, specific, encoding): @@ -60,3 +62,10 @@ class TCheetah(Bcfg2.Server.Plugin.GroupSpool): filename_pattern = 'template' es_child_cls = TemplateFile + def __init__(self, core, datastore): + try: + import Cheetah.Template + import Cheetah.Parser + except: + logger.error("Failed to import TCheetah. Is it installed?") + raise Bcfg2.Server.Plugin.PluginInitError |