summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/TCheetah.py
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2009-07-13 20:35:31 +0000
committerSol Jerome <solj@ices.utexas.edu>2009-07-13 20:35:31 +0000
commitfebcfaad2e7a7dc5e15f397bf1a5aea05d40b865 (patch)
tree4ab76cceeba7e2c3993905fd4432e76f5ab3ff3a /src/lib/Server/Plugins/TCheetah.py
parentd62de77749717857475f8dbc519c45572ae236db (diff)
downloadbcfg2-febcfaad2e7a7dc5e15f397bf1a5aea05d40b865.tar.gz
bcfg2-febcfaad2e7a7dc5e15f397bf1a5aea05d40b865.tar.bz2
bcfg2-febcfaad2e7a7dc5e15f397bf1a5aea05d40b865.zip
TCheetah: Remove RPM python-cheetah requirement
Cheetah is not considered a requirement on the server. A check has been added to see if it is installed when trying to instantiate the TCheetah plugin. Signed-off-by: Sol Jerome <solj@ices.utexas.edu> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5324 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/TCheetah.py')
-rw-r--r--src/lib/Server/Plugins/TCheetah.py13
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