summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-03-21 15:24:55 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-03-21 15:24:55 +0000
commitd1040d8565d4cdea17663c797ed14d095e9cac9d (patch)
tree0fc6a9dba9f42417fc01702d47f66e45140de1d2
parentf101764921503cddf322865088f885f3b2e6134b (diff)
downloadbcfg2-d1040d8565d4cdea17663c797ed14d095e9cac9d.tar.gz
bcfg2-d1040d8565d4cdea17663c797ed14d095e9cac9d.tar.bz2
bcfg2-d1040d8565d4cdea17663c797ed14d095e9cac9d.zip
clean up event handling and handle specificityerrors
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4429 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--src/lib/Server/Plugin.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py
index 4ad48838b..ba63995f8 100644
--- a/src/lib/Server/Plugin.py
+++ b/src/lib/Server/Plugin.py
@@ -435,10 +435,13 @@ class EntrySet:
if action in ['exists', 'created']:
self.entry_init(event)
- elif action == 'changed':
- self.entries[event.filename].handle_event(event)
- elif action == 'deleted':
- del self.entries[event.filename]
+ else:
+ if event.filename not in self.entries:
+ return
+ if action == 'changed':
+ self.entries[event.filename].handle_event(event)
+ elif action == 'deleted':
+ del self.entries[event.filename]
def entry_init(self, event):
'''handle template and info file creation'''
@@ -446,7 +449,11 @@ class EntrySet:
logger.warn("Got duplicate add for %s" % event.filename)
else:
fpath = "%s/%s" % (self.path, event.filename)
- spec = Specificity(self.specific, event.filename)
+ try:
+ spec = Specificity(self.specific, event.filename)
+ except SpecificityError:
+ logger.error("Could not process filename %s; ignoring" % fpath)
+ return
self.entries[event.filename] = self.entry_type(fpath,
self.properties,
spec)