summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--redhat/bcfg2.spec.in1
-rw-r--r--src/lib/Server/Plugins/TCheetah.py13
2 files changed, 11 insertions, 3 deletions
diff --git a/redhat/bcfg2.spec.in b/redhat/bcfg2.spec.in
index 6133d26cd..ca3c8b531 100644
--- a/redhat/bcfg2.spec.in
+++ b/redhat/bcfg2.spec.in
@@ -73,7 +73,6 @@ Requires: bcfg2 = %{version}-%{release}
Requires: /usr/bin/openssl
Requires: gamin-python
Requires: python-genshi
-Requires: python-cheetah
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(preun): /sbin/service
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