From d1040d8565d4cdea17663c797ed14d095e9cac9d Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Fri, 21 Mar 2008 15:24:55 +0000 Subject: 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 --- src/lib/Server/Plugin.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src') 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) -- cgit v1.2.3-1-g7c22