amend for 1b4ba602bac38a067b5abb9a941feab53c36c915: use common bool-converter

pull/2133/head
sebres 2018-04-26 16:52:40 +02:00
parent 532cb35aa8
commit 7a3932efc0
1 changed files with 2 additions and 3 deletions

View File

@ -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']: