mirror of https://github.com/fail2ban/fail2ban
wrong indentation (important code-piece in if log-level only)
parent
39c343bd06
commit
8018796b45
|
@ -326,8 +326,8 @@ class DateDetector(object):
|
||||||
if template.flags & (DateTemplate.LINE_BEGIN|DateTemplate.LINE_END):
|
if template.flags & (DateTemplate.LINE_BEGIN|DateTemplate.LINE_END):
|
||||||
if logSys.getEffectiveLevel() <= logLevel-1: # pragma: no cover - very-heavy debug
|
if logSys.getEffectiveLevel() <= logLevel-1: # pragma: no cover - very-heavy debug
|
||||||
logSys.log(logLevel-1, " try to match last anchored template #%02i ...", i)
|
logSys.log(logLevel-1, " try to match last anchored template #%02i ...", i)
|
||||||
match = template.matchDate(line)
|
match = template.matchDate(line)
|
||||||
ignoreBySearch = i
|
ignoreBySearch = i
|
||||||
else:
|
else:
|
||||||
distance, endpos = self.__lastPos[0], self.__lastEndPos[0]
|
distance, endpos = self.__lastPos[0], self.__lastEndPos[0]
|
||||||
if logSys.getEffectiveLevel() <= logLevel-1:
|
if logSys.getEffectiveLevel() <= logLevel-1:
|
||||||
|
@ -357,7 +357,6 @@ class DateDetector(object):
|
||||||
logSys.log(logLevel, " ** last pattern not found - pattern change, search ...")
|
logSys.log(logLevel, " ** last pattern not found - pattern change, search ...")
|
||||||
# search template and better match:
|
# search template and better match:
|
||||||
if not match:
|
if not match:
|
||||||
self.__lastTemplIdx = 0x7fffffff
|
|
||||||
logSys.log(logLevel, " search template (%i) ...", len(self.__templates))
|
logSys.log(logLevel, " search template (%i) ...", len(self.__templates))
|
||||||
found = None, 0x7fffffff, 0x7fffffff, -1
|
found = None, 0x7fffffff, 0x7fffffff, -1
|
||||||
i = 0
|
i = 0
|
||||||
|
@ -414,7 +413,7 @@ class DateDetector(object):
|
||||||
self.__lastPos = distance, line[distance-1:distance]
|
self.__lastPos = distance, line[distance-1:distance]
|
||||||
self.__lastEndPos = endpos, line[endpos:endpos+1]
|
self.__lastEndPos = endpos, line[endpos:endpos+1]
|
||||||
# if not first - try to reorder current template (bubble up), they will be not sorted anymore:
|
# if not first - try to reorder current template (bubble up), they will be not sorted anymore:
|
||||||
if i:
|
if i and i != self.__lastTemplIdx:
|
||||||
i = self._reorderTemplate(i)
|
i = self._reorderTemplate(i)
|
||||||
self.__lastTemplIdx = i
|
self.__lastTemplIdx = i
|
||||||
# return tuple with match and template reference used for parsing:
|
# return tuple with match and template reference used for parsing:
|
||||||
|
|
Loading…
Reference in New Issue