mirror of https://github.com/fail2ban/fail2ban
amend to merge: replace timedelta string representation with new function seconds2str
parent
0b3ad780fe
commit
4fe4ac8dde
|
@ -462,7 +462,7 @@ class ObserverThread(JailThread):
|
||||||
if ticket.getTime() > timeOfBan:
|
if ticket.getTime() > timeOfBan:
|
||||||
logSys.info('[%s] IP %s is bad: %s # last %s - incr %s to %s' % (jail.name, ip, banCount,
|
logSys.info('[%s] IP %s is bad: %s # last %s - incr %s to %s' % (jail.name, ip, banCount,
|
||||||
MyTime.time2str(timeOfBan),
|
MyTime.time2str(timeOfBan),
|
||||||
datetime.timedelta(seconds=int(orgBanTime)), datetime.timedelta(seconds=int(banTime))));
|
MyTime.seconds2str(orgBanTime), MyTime.seconds2str(banTime)))
|
||||||
else:
|
else:
|
||||||
ticket.restored = True
|
ticket.restored = True
|
||||||
break
|
break
|
||||||
|
@ -491,8 +491,7 @@ class ObserverThread(JailThread):
|
||||||
# if not permanent
|
# if not permanent
|
||||||
if btime != -1:
|
if btime != -1:
|
||||||
bendtime = ticket.getTime() + btime
|
bendtime = ticket.getTime() + btime
|
||||||
logtime = (datetime.timedelta(seconds=int(btime)),
|
logtime = (MyTime.seconds2str(btime), MyTime.time2str(bendtime))
|
||||||
MyTime.time2str(bendtime))
|
|
||||||
# check ban is not too old :
|
# check ban is not too old :
|
||||||
if bendtime < MyTime.time():
|
if bendtime < MyTime.time():
|
||||||
logSys.debug('Ignore old bantime %s', logtime[1])
|
logSys.debug('Ignore old bantime %s', logtime[1])
|
||||||
|
|
Loading…
Reference in New Issue