diff --git a/MANIFEST b/MANIFEST index 1d574327..9aa49d15 100644 --- a/MANIFEST +++ b/MANIFEST @@ -18,12 +18,10 @@ client/__init__.py client/configurator.py client/csocket.py server/asyncserver.py -server/banticket.py server/filter.py server/filtergamin.py server/filterpoll.py server/server.py -server/failticket.py server/actions.py server/faildata.py server/failmanager.py diff --git a/server/banmanager.py b/server/banmanager.py index 8e068f6e..13c2a307 100644 --- a/server/banmanager.py +++ b/server/banmanager.py @@ -24,7 +24,7 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -from banticket import BanTicket +from ticket import BanTicket from threading import Lock from mytime import MyTime import logging diff --git a/server/banticket.py b/server/banticket.py deleted file mode 100644 index 67e5def1..00000000 --- a/server/banticket.py +++ /dev/null @@ -1,50 +0,0 @@ -# This file is part of Fail2Ban. -# -# Fail2Ban is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Fail2Ban is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -# Author: Cyril Jaquier -# -# $Revision$ - -__author__ = "Cyril Jaquier" -__version__ = "$Revision$" -__date__ = "$Date$" -__copyright__ = "Copyright (c) 2004 Cyril Jaquier" -__license__ = "GPL" - -import logging -from ticket import Ticket - -# Gets the instance of the logger. -logSys = logging.getLogger("fail2ban") - -## -# Ban Ticket. -# -# This class extends the Ticket class. It is mainly used by the BanManager. - -class BanTicket(Ticket): - - ## - # Constructor. - # - # Call the Ticket (parent) constructor and initialize default - # values. - # @param ip the IP address - # @param time the ban time - - def __init__(self, ip, time): - Ticket.__init__(self, ip, time) - \ No newline at end of file diff --git a/server/failmanager.py b/server/failmanager.py index 9101ac62..b5e95867 100644 --- a/server/failmanager.py +++ b/server/failmanager.py @@ -25,7 +25,7 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" from faildata import FailData -from failticket import FailTicket +from ticket import FailTicket from threading import Lock import logging diff --git a/server/failticket.py b/server/failticket.py deleted file mode 100644 index bc8e6c4d..00000000 --- a/server/failticket.py +++ /dev/null @@ -1,37 +0,0 @@ -# This file is part of Fail2Ban. -# -# Fail2Ban is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Fail2Ban is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Fail2Ban; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -# Author: Cyril Jaquier -# -# $Revision$ - -__author__ = "Cyril Jaquier" -__version__ = "$Revision$" -__date__ = "$Date$" -__copyright__ = "Copyright (c) 2004 Cyril Jaquier" -__license__ = "GPL" - -import logging -from ticket import Ticket - -# Gets the instance of the logger. -logSys = logging.getLogger("fail2ban") - -class FailTicket(Ticket): - - def __init__(self, ip, time): - Ticket.__init__(self, ip, time) - \ No newline at end of file diff --git a/server/ticket.py b/server/ticket.py index ee274eab..3c0312b0 100644 --- a/server/ticket.py +++ b/server/ticket.py @@ -53,4 +53,28 @@ class Ticket: def getAttempt(self): return self.__attempt - \ No newline at end of file + + +class FailTicket(Ticket): + + def __init__(self, ip, time): + Ticket.__init__(self, ip, time) + + +## +# Ban Ticket. +# +# This class extends the Ticket class. It is mainly used by the BanManager. + +class BanTicket(Ticket): + + ## + # Constructor. + # + # Call the Ticket (parent) constructor and initialize default + # values. + # @param ip the IP address + # @param time the ban time + + def __init__(self, ip, time): + Ticket.__init__(self, ip, time) diff --git a/testcases/banmanagertestcase.py b/testcases/banmanagertestcase.py index fee58631..644cf6cb 100644 --- a/testcases/banmanagertestcase.py +++ b/testcases/banmanagertestcase.py @@ -24,9 +24,9 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -import unittest, socket, time, pickle +import unittest from server.banmanager import BanManager -from server.banticket import BanTicket +from server.ticket import BanTicket class AddFailure(unittest.TestCase): diff --git a/testcases/failmanagertestcase.py b/testcases/failmanagertestcase.py index 1e761b6c..7dfed256 100644 --- a/testcases/failmanagertestcase.py +++ b/testcases/failmanagertestcase.py @@ -25,9 +25,8 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" import unittest, socket, time, pickle -from server.failmanager import FailManager -from server.failmanager import FailManagerEmpty -from server.failticket import FailTicket +from server.failmanager import FailManager, FailManagerEmpty +from server.ticket import FailTicket class AddFailure(unittest.TestCase):