mirror of https://github.com/fail2ban/fail2ban
Merge pull request #29 from leeclemens/enh/pyinotify
BF: Fixed and added error message if no backends initialized...pull/27/merge
commit
35e9f6e464
|
@ -49,8 +49,10 @@ class Jail:
|
|||
if backend != 'auto':
|
||||
# we have got strict specification of the backend to use
|
||||
if not (backend in self._BACKENDS):
|
||||
logSys.error("Unknown backend %s. Must be among %s or 'auto'"
|
||||
% (backend, backends))
|
||||
raise ValueError("Unknown backend %s. Must be among %s or 'auto'"
|
||||
% (backend, backends))
|
||||
% (backend, backends))
|
||||
# so explore starting from it till the 'end'
|
||||
backends = backends[backends.index(backend):]
|
||||
|
||||
|
@ -68,8 +70,11 @@ class Jail:
|
|||
except ImportError, e:
|
||||
logSys.debug(
|
||||
"Backend %r failed to initialize due to %s" % (b, e))
|
||||
# log error since runtime error message isn't printed, INVALID COMMAND
|
||||
logSys.error(
|
||||
"Failed to initialize any backend for Jail %r" % self.__name)
|
||||
raise RuntimeError(
|
||||
"We should have initialized at least 'polling' backend")
|
||||
"Failed to initialize any backend for Jail %r" % self.__name)
|
||||
|
||||
|
||||
def _initPolling(self):
|
||||
|
|
Loading…
Reference in New Issue