From b159eabb517e97781ef2a45ab14a0ff9b9376b9a Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 6 Nov 2012 13:14:42 -0500 Subject: [PATCH] BF: do not enable pyinotify backend if pyinotify is too old (Closes gh-80) --- server/filterpyinotify.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/filterpyinotify.py b/server/filterpyinotify.py index 008f93038..fdc7256ec 100644 --- a/server/filterpyinotify.py +++ b/server/filterpyinotify.py @@ -23,12 +23,18 @@ __author__ = "Cyril Jaquier, Lee Clemens, Yaroslav Halchenko" __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2011-2012 Lee Clemens, 2012 Yaroslav Halchenko" __license__ = "GPL" +from distutils.version import LooseVersion + from failmanager import FailManagerEmpty from filter import FileFilter from mytime import MyTime import time, logging, pyinotify +if not hasattr(pyinotify, '__version__') \ + or LooseVersion(pyinotify.__version__) < '0.8.3': + raise ImportError("Fail2Ban requires pyinotify >= 0.8.3") + from os.path import dirname, sep as pathsep # Gets the instance of the logger.