From ce2c306c68a01349a28d8a3356ceff3efc153e28 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Sun, 24 May 2009 23:55:57 +0000 Subject: Make pseudofam work on systems without Gamin git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5256 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/FileMonitor.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/lib/Server/FileMonitor.py') diff --git a/src/lib/Server/FileMonitor.py b/src/lib/Server/FileMonitor.py index 566e99477..4b980a098 100644 --- a/src/lib/Server/FileMonitor.py +++ b/src/lib/Server/FileMonitor.py @@ -34,14 +34,9 @@ class GaminEvent(Event): ''' def __init__(self, request_id, filename, code): Event.__init__(self, request_id, filename, code) - action_map = {} - if 'fam' not in available and 'gamin' not in available: - pass - else: - # Only works if Gamin or Fam is present - action_map = {GAMCreated: 'created', GAMExists: 'exists', - GAMChanged: 'changed', GAMDeleted: 'deleted', - GAMEndExist: 'endExist', GAMMoved: 'moved'} + action_map = {GAMCreated: 'created', GAMExists: 'exists', + GAMChanged: 'changed', GAMDeleted: 'deleted', + GAMEndExist: 'endExist', GAMMoved: 'moved'} if code in action_map: self.action = action_map[code] @@ -191,10 +186,10 @@ class Pseudo(FileMonitor): dirList = os.listdir(path) self.pending_events.append(handle) for includedFile in dirList: - self.pending_events.append(GaminEvent(handleID, includedFile, 'exists')) - self.pending_events.append(GaminEvent(handleID, path, 'endExist')) + self.pending_events.append(Event(handleID, includedFile, 'exists')) + self.pending_events.append(Event(handleID, path, 'endExist')) else: - self.pending_events.append(GaminEvent(handleID, path, 'exists')) + self.pending_events.append(Event(handleID, path, 'exists')) if obj != None: self.handles[handleID] = obj return handleID -- cgit v1.2.3-1-g7c22