summaryrefslogtreecommitdiffstats
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
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
-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