From 58acd9fb9ff89f1bada081e2bbc629dde83a11ea Mon Sep 17 00:00:00 2001 From: Cyril Jaquier Date: Thu, 16 Nov 2006 21:07:42 +0000 Subject: [PATCH] - Moved version.py and protocol.py to common/ git-svn-id: https://fail2ban.svn.sourceforge.net/svnroot/fail2ban/trunk@467 a942ae1a-1317-0410-a47c-b1dcaea8d605 --- CHANGELOG | 2 ++ MANIFEST | 5 +++-- common/__init__.py | 25 +++++++++++++++++++++++++ protocol.py => common/protocol.py | 0 version.py => common/version.py | 0 fail2ban-client | 4 ++-- fail2ban-regex | 2 +- fail2ban-server | 2 +- fail2ban-testcases | 2 +- setup.py | 14 ++++++-------- 10 files changed, 41 insertions(+), 15 deletions(-) create mode 100644 common/__init__.py rename protocol.py => common/protocol.py (100%) rename version.py => common/version.py (100%) diff --git a/CHANGELOG b/CHANGELOG index 5ccbf134..4b82a3e9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,8 @@ ver. 0.7.5 (2006/??/??) - ??? - Added option "ignoreregex" in filter scripts and jail.conf. Feature Request #1283304 - Fixed a bug in user defined time regex/pattern +- Improved documentation +- Moved version.py and protocol.py to common/ ver. 0.7.4 (2006/11/01) - beta ---------- diff --git a/MANIFEST b/MANIFEST index c055a5f0..db392e40 100644 --- a/MANIFEST +++ b/MANIFEST @@ -53,8 +53,9 @@ testcases/files/testcase03.log testcases/files/testcase04.log setup.py setup.cfg -version.py -protocol.py +common/__init__.py +common/version.py +common/protocol.py config/jail.conf config/filter.d/postfix.conf config/filter.d/vsftpd.conf diff --git a/common/__init__.py b/common/__init__.py new file mode 100644 index 00000000..cf63d1b6 --- /dev/null +++ b/common/__init__.py @@ -0,0 +1,25 @@ +# 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: 433 $ + +__author__ = "Cyril Jaquier" +__version__ = "$Revision: 433 $" +__date__ = "$Date: 2006-10-24 21:40:51 +0200 (Tue, 24 Oct 2006) $" +__copyright__ = "Copyright (c) 2004 Cyril Jaquier" +__license__ = "GPL" diff --git a/protocol.py b/common/protocol.py similarity index 100% rename from protocol.py rename to common/protocol.py diff --git a/version.py b/common/version.py similarity index 100% rename from version.py rename to common/version.py diff --git a/fail2ban-client b/fail2ban-client index dff6aedd..c3f2fdec 100755 --- a/fail2ban-client +++ b/fail2ban-client @@ -33,11 +33,11 @@ import getopt, time, readline, shlex, socket sys.path.insert(1, "/usr/lib/fail2ban") # Now we can import our modules -from version import version +from common.version import version +from common.protocol import printFormatted from client.csocket import CSocket from client.configurator import Configurator from client.beautifier import Beautifier -from protocol import printFormatted # Gets the instance of the logger. logSys = logging.getLogger("fail2ban.client") diff --git a/fail2ban-regex b/fail2ban-regex index 8d82641a..6f4849ad 100755 --- a/fail2ban-regex +++ b/fail2ban-regex @@ -31,7 +31,7 @@ import locale, getopt, sys, time, logging, gc # fix for bug #343821 sys.path.insert(1, "/usr/lib/fail2ban") -from version import version +from common.version import version from server.filter import Filter # Gets the instance of the logger. diff --git a/fail2ban-server b/fail2ban-server index c7877971..1f022d13 100755 --- a/fail2ban-server +++ b/fail2ban-server @@ -31,7 +31,7 @@ import getopt, sys # fix for bug #343821 sys.path.insert(1, "/usr/lib/fail2ban") -from version import version +from common.version import version from server.server import Server ## diff --git a/fail2ban-testcases b/fail2ban-testcases index b2eaa47c..91c34317 100755 --- a/fail2ban-testcases +++ b/fail2ban-testcases @@ -32,7 +32,7 @@ import unittest, logging, sys # fix for bug #343821 sys.path.insert(1, "/usr/lib/fail2ban") -from version import version +from common.version import version from testcases import banmanagertestcase from testcases import clientreadertestcase from testcases import failmanagertestcase diff --git a/setup.py b/setup.py index 4aed98dc..f5eb71ca 100755 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" from distutils.core import setup -from version import version +from common.version import version from os.path import isfile, join from sys import argv from glob import glob @@ -54,24 +54,21 @@ setup( 'fail2ban-server', 'fail2ban-regex' ], - py_modules = [ - 'version', - 'protocol' - ], packages = [ + 'common', 'client', 'server' ], data_files = [ ('/etc/fail2ban', glob("config/*.conf") - ), + ), ('/etc/fail2ban/filter.d', glob("config/filter.d/*.conf") - ), + ), ('/etc/fail2ban/action.d', glob("config/action.d/*.conf") - ) + ) ] ) @@ -100,6 +97,7 @@ for directory in elements: path = join(directory, f) if isfile(path): obsoleteFiles.append(path) + if obsoleteFiles: print print "Obsolete files from previous Fail2Ban versions were found on " \