- Stop reading log file when jail is no more active

git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@437 a942ae1a-1317-0410-a47c-b1dcaea8d605
0.x
Cyril Jaquier 18 years ago
parent ae0ed204ee
commit 150a6abd0d

@ -354,6 +354,9 @@ class Filter(JailThread):
self.__setFilePos()
lastLine = None
for line in self.__crtHandler:
if not self.isActive():
# The jail has been stopped
break
try:
# Decode line to UTF-8
line = line.decode('utf-8')

@ -24,7 +24,7 @@ __date__ = "$Date$"
__copyright__ = "Copyright (c) 2004 Cyril Jaquier"
__license__ = "GPL"
import unittest, socket
import unittest
from server.filterpoll import FilterPoll
from server.filter import Filter
from server.failmanager import FailManager
@ -87,6 +87,8 @@ class GetFailures(unittest.TestCase):
def setUp(self):
"""Call before every test case."""
self.__filter = Filter(None)
self.__filter.setActive(True)
# TODO Test this
#self.__filter.setTimeRegex("\S{3}\s{1,2}\d{1,2} \d{2}:\d{2}:\d{2}")
#self.__filter.setTimePattern("%b %d %H:%M:%S")

Loading…
Cancel
Save