mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
amend for 1b4ba602ba: use common bool-converter
This commit is contained in:
parent
532cb35aa8
commit
7a3932efc0
1 changed files with 2 additions and 3 deletions
|
|
@ -29,7 +29,7 @@ import random
|
|||
import Queue
|
||||
|
||||
from .actions import Actions
|
||||
from ..helpers import getLogger, extractOptions, MyTime
|
||||
from ..helpers import getLogger, _as_bool, extractOptions, MyTime
|
||||
from .mytime import MyTime
|
||||
|
||||
# Gets the instance of the logger.
|
||||
|
|
@ -223,8 +223,7 @@ class Jail(object):
|
|||
del be[opt]
|
||||
logSys.info('Set banTime.%s = %s', opt, value)
|
||||
if opt == 'increment':
|
||||
if isinstance(value, str):
|
||||
be[opt] = value.lower() in ("yes", "true", "ok", "1")
|
||||
be[opt] = _as_bool(value)
|
||||
if be.get(opt) and self.database is None:
|
||||
logSys.warning("ban time increment is not available as long jail database is not set")
|
||||
if opt in ['maxtime', 'rndtime']:
|
||||
|
|
|
|||
Loading…
Reference in a new issue