mirror of https://github.com/fail2ban/fail2ban
ENH: Set date to "today" when neither month nor day is time match
parent
9db44059fd
commit
49f9143535
|
@ -208,7 +208,8 @@ class DateStrptime(DateTemplate):
|
||||||
# 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
|
||||||
# is neither month nor day in the log.
|
# is neither month nor day in the log.
|
||||||
# NOTE: Possibly makes week/year day incorrect
|
# NOTE: Possibly makes week/year day incorrect
|
||||||
date = date.replace(month=MyTime.gmtime()[1], day=1)
|
date = date.replace(
|
||||||
|
month=MyTime.gmtime()[1], day=MyTime.gmtime()[2])
|
||||||
|
|
||||||
if date.tzinfo:
|
if date.tzinfo:
|
||||||
return ( calendar.timegm(date.utctimetuple()), dateMatch )
|
return ( calendar.timegm(date.utctimetuple()), dateMatch )
|
||||||
|
|
Loading…
Reference in New Issue