mirror of https://github.com/fail2ban/fail2ban
time.mktime argument should be tuple
parent
2ecf34540e
commit
ad7119a3fe
|
@ -194,7 +194,7 @@ class DateDetector:
|
||||||
if date == None:
|
if date == None:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
return time.mktime(date)
|
return time.mktime(tuple(date))
|
||||||
|
|
||||||
##
|
##
|
||||||
# Sort the template lists using the hits score. This method is not called
|
# Sort the template lists using the hits score. This method is not called
|
||||||
|
|
|
@ -162,10 +162,10 @@ class DateStrptime(DateTemplate):
|
||||||
# Bug fix for #1241756
|
# Bug fix for #1241756
|
||||||
# If the date is greater than the current time, we suppose
|
# If the date is greater than the current time, we suppose
|
||||||
# that the log is not from this year but from the year before
|
# that the log is not from this year but from the year before
|
||||||
if time.mktime(date) > MyTime.time():
|
if time.mktime(tuple(date)) > MyTime.time():
|
||||||
logSys.debug(
|
logSys.debug(
|
||||||
u"Correcting deduced year from %d to %d since %f > %f" %
|
"Correcting deduced year from %d to %d since %f > %f" %
|
||||||
(date[0], date[0]-1, time.mktime(date), MyTime.time()))
|
(date[0], date[0]-1, time.mktime(tuple(date)), MyTime.time()))
|
||||||
date[0] -= 1
|
date[0] -= 1
|
||||||
elif date[1] == 1 and date[2] == 1:
|
elif date[1] == 1 and date[2] == 1:
|
||||||
# If it is Jan 1st, it is either really Jan 1st or there
|
# If it is Jan 1st, it is either really Jan 1st or there
|
||||||
|
|
Loading…
Reference in New Issue