mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
pyinotify: be sure possible IOError/OSError by remove monitor (log-rotate? normally not raises) are handled properly.
This commit is contained in:
parent
7867228146
commit
e5169d8f84
1 changed files with 6 additions and 0 deletions
|
|
@ -231,6 +231,9 @@ class FilterPyinotify(FileFilter):
|
|||
return True
|
||||
except KeyError: # pragma: no cover
|
||||
pass
|
||||
# EnvironmentError is parent of IOError, OSError, etc.
|
||||
except EnvironmentError as e: # pragma: no cover (normally unreached)
|
||||
logSys.error("Remove file monitor for %s causes %s", path, e)
|
||||
return False
|
||||
|
||||
def _addDirWatcher(self, path_dir):
|
||||
|
|
@ -249,6 +252,9 @@ class FilterPyinotify(FileFilter):
|
|||
self.__monitor.rm_watch(wdInt)
|
||||
except KeyError: # pragma: no cover
|
||||
pass
|
||||
# EnvironmentError is parent of IOError, OSError, etc.
|
||||
except EnvironmentError as e: # pragma: no cover (normally unreached)
|
||||
logSys.error("Remove monitor for the parent directory %s causes %s", path_dir, e)
|
||||
logSys.debug("Removed monitor for the parent directory %s", path_dir)
|
||||
|
||||
##
|
||||
|
|
|
|||
Loading…
Reference in a new issue