mirror of https://github.com/fail2ban/fail2ban
pyinotify: be sure possible IOError/OSError by remove monitor (log-rotate? normally not raises) are handled properly.
parent
7867228146
commit
e5169d8f84
|
@ -231,6 +231,9 @@ class FilterPyinotify(FileFilter):
|
||||||
return True
|
return True
|
||||||
except KeyError: # pragma: no cover
|
except KeyError: # pragma: no cover
|
||||||
pass
|
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
|
return False
|
||||||
|
|
||||||
def _addDirWatcher(self, path_dir):
|
def _addDirWatcher(self, path_dir):
|
||||||
|
@ -249,6 +252,9 @@ class FilterPyinotify(FileFilter):
|
||||||
self.__monitor.rm_watch(wdInt)
|
self.__monitor.rm_watch(wdInt)
|
||||||
except KeyError: # pragma: no cover
|
except KeyError: # pragma: no cover
|
||||||
pass
|
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)
|
logSys.debug("Removed monitor for the parent directory %s", path_dir)
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in New Issue