summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-09-28 00:49:53 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-09-28 00:49:53 +0000
commit03c932e5ee8c422fe61ed67a861f8b5f3edf4aac (patch)
tree23908a6b2d716826cc461944e4c88a52399c0660 /src
parenta9abc440cc0c411f9975e1827d71776364bdb659 (diff)
downloadbcfg2-03c932e5ee8c422fe61ed67a861f8b5f3edf4aac.tar.gz
bcfg2-03c932e5ee8c422fe61ed67a861f8b5f3edf4aac.tar.bz2
bcfg2-03c932e5ee8c422fe61ed67a861f8b5f3edf4aac.zip
Handle templates properly, regardless of event order (resolves ticket #158)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2336 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Plugins/TCheetah.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/Server/Plugins/TCheetah.py b/src/lib/Server/Plugins/TCheetah.py
index 0ef453a9e..4e95fce35 100644
--- a/src/lib/Server/Plugins/TCheetah.py
+++ b/src/lib/Server/Plugins/TCheetah.py
@@ -20,13 +20,14 @@ class TemplateFile:
'''Handle all fs events for this template'''
if event.filename == 'template':
try:
- self.template = Cheetah.Template.Template(open(self.name).read())
+ self.template = Cheetah.Template.Template(open(self.name + \
+ '/template').read())
self.template.properties = self.properties.properties
except Cheetah.Parser.ParseError, perror:
logger.error("Cheetah parse error for file %s" % (self.name))
logger.error(perror.report())
elif event.filename == 'info':
- for line in open(self.name[:-8] + '/info').readlines():
+ for line in open(self.name + '/info').readlines():
match = info.match(line)
if not match:
logger.warning("Failed to match line: %s"%line)
@@ -99,7 +100,7 @@ class TCheetah(Bcfg2.Server.Plugin.Plugin):
self.AddDirectoryMonitor(epath[len(self.data):])
else:
if not self.entries.has_key(identifier):
- self.entries[identifier] = TemplateFile(epath, self.properties)
+ self.entries[identifier] = TemplateFile(identifier, self.properties)
self.Entries['ConfigFile'][identifier] = self.BuildEntry
self.entries[identifier].HandleEvent(event)
elif action == 'changed':