[GNOME-ABRT PATCH] Skip inotify events for sub folders in dump location watcher
Jakub Filak
jfilak at redhat.com
Fri Jul 19 14:30:20 UTC 2013
Closes rhbz#975069
Signed-off-by: Jakub Filak <jfilak at redhat.com>
---
src/gnome_abrt/directory_problems.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/gnome_abrt/directory_problems.py b/src/gnome_abrt/directory_problems.py
index 56bbbe2..29a7ed0 100644
--- a/src/gnome_abrt/directory_problems.py
+++ b/src/gnome_abrt/directory_problems.py
@@ -131,12 +131,17 @@ class INOTIFYSourceHandler(ProcessEvent):
#pylint: disable=E1101
MASK = pyinotify.IN_MOVED_TO
- def __init__(self, source):
+ def __init__(self, source, directory):
super(INOTIFYSourceHandler, self).__init__()
self.source = source
+ self.directory = directory
#pylint: disable=C0103
def process_IN_MOVED_TO(self, event):
+ if self.directory != event.path:
+ logging.debug("Something has been moved to a child directory")
+ return
+
try:
self.source.process_new_problem_id(
os.path.join(event.path, event.name))
@@ -160,7 +165,7 @@ class INOTIFYWatcher:
self._wm = WatchManager()
try:
- ihndlr = INOTIFYSourceHandler(self._source)
+ ihndlr = INOTIFYSourceHandler(self._source, self._directory)
self._gsource = INOTIFYGlibSource(self._wm,
self._directory, ihndlr)
except OSError as ex:
--
1.8.3.1
More information about the Crash-catcher
mailing list