diff --git a/fail2ban/client/actionreader.py b/fail2ban/client/actionreader.py index 77ca1088..4452abe5 100644 --- a/fail2ban/client/actionreader.py +++ b/fail2ban/client/actionreader.py @@ -25,7 +25,8 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" import logging, os -from configreader import ConfigReader, DefinitionInitConfigReader + +from fail2ban.client.configreader import ConfigReader, DefinitionInitConfigReader # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/client/configreader.py b/fail2ban/client/configreader.py index ddbc48db..337eb31e 100644 --- a/fail2ban/client/configreader.py +++ b/fail2ban/client/configreader.py @@ -25,9 +25,10 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" import glob, logging, os -from configparserinc import SafeConfigParserWithIncludes from ConfigParser import NoOptionError, NoSectionError +from fail2ban.client.configparserinc import SafeConfigParserWithIncludes + # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/client/configurator.py b/fail2ban/client/configurator.py index aa64704a..bd0fbb79 100644 --- a/fail2ban/client/configurator.py +++ b/fail2ban/client/configurator.py @@ -25,9 +25,10 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" import logging -from configreader import ConfigReader -from fail2banreader import Fail2banReader -from jailsreader import JailsReader + +from fail2ban.client.configreader import ConfigReader +from fail2ban.client.fail2banreader import Fail2banReader +from fail2ban.client.jailsreader import JailsReader # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/client/fail2banreader.py b/fail2ban/client/fail2banreader.py index d5d7285a..0df8d352 100644 --- a/fail2ban/client/fail2banreader.py +++ b/fail2ban/client/fail2banreader.py @@ -25,7 +25,8 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" import logging -from configreader import ConfigReader + +from fail2ban.client.configreader import ConfigReader # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/client/filterreader.py b/fail2ban/client/filterreader.py index d8a6dbe8..27b3c3c4 100644 --- a/fail2ban/client/filterreader.py +++ b/fail2ban/client/filterreader.py @@ -25,7 +25,8 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" import logging, os, shlex -from configreader import ConfigReader, DefinitionInitConfigReader + +from fail2ban.client.configreader import ConfigReader, DefinitionInitConfigReader # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/client/jailreader.py b/fail2ban/client/jailreader.py index c17ea6c5..6e83f05c 100644 --- a/fail2ban/client/jailreader.py +++ b/fail2ban/client/jailreader.py @@ -26,9 +26,9 @@ __license__ = "GPL" import logging, re, glob, os.path -from configreader import ConfigReader -from filterreader import FilterReader -from actionreader import ActionReader +from fail2ban.client.configreader import ConfigReader +from fail2ban.client.filterreader import FilterReader +from fail2ban.client.actionreader import ActionReader # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/client/jailsreader.py b/fail2ban/client/jailsreader.py index c52f1b2b..284d18d8 100644 --- a/fail2ban/client/jailsreader.py +++ b/fail2ban/client/jailsreader.py @@ -25,8 +25,9 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" import logging -from configreader import ConfigReader -from jailreader import JailReader + +from fail2ban.client.configreader import ConfigReader +from fail2ban.client.jailreader import JailReader # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/server/actions.py b/fail2ban/server/actions.py index af2b4670..2c141895 100644 --- a/fail2ban/server/actions.py +++ b/fail2ban/server/actions.py @@ -24,12 +24,13 @@ __author__ = "Cyril Jaquier" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -from banmanager import BanManager -from jailthread import JailThread -from action import Action -from mytime import MyTime import time, logging +from fail2ban.server.banmanager import BanManager +from fail2ban.server.jailthread import JailThread +from fail2ban.server.action import Action +from fail2ban.server.mytime import MyTime + # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/server/banmanager.py b/fail2ban/server/banmanager.py index ef3bf204..82027089 100644 --- a/fail2ban/server/banmanager.py +++ b/fail2ban/server/banmanager.py @@ -24,10 +24,11 @@ __author__ = "Cyril Jaquier" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -from ticket import BanTicket -from threading import Lock -from mytime import MyTime import logging +from threading import Lock + +from fail2ban.server.ticket import BanTicket +from fail2ban.server.mytime import MyTime # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/server/datedetector.py b/fail2ban/server/datedetector.py index 002a1070..91541b92 100644 --- a/fail2ban/server/datedetector.py +++ b/fail2ban/server/datedetector.py @@ -22,10 +22,10 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" import sys, time, logging - -from datetemplate import DatePatternRegex, DateTai64n, DateEpoch, DateISO8601 from threading import Lock +from fail2ban.server.datetemplate import DatePatternRegex, DateTai64n, DateEpoch, DateISO8601 + # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/server/datetemplate.py b/fail2ban/server/datetemplate.py index 320d9dc0..0aa20472 100644 --- a/fail2ban/server/datetemplate.py +++ b/fail2ban/server/datetemplate.py @@ -25,14 +25,13 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" import re, time, calendar - +import logging from datetime import datetime from datetime import timedelta -from mytime import MyTime -import iso8601 +from fail2ban.server.mytime import MyTime +from fail2ban.server import iso8601 -import logging logSys = logging.getLogger(__name__) diff --git a/fail2ban/server/failmanager.py b/fail2ban/server/failmanager.py index f021a46d..6527e1ab 100644 --- a/fail2ban/server/failmanager.py +++ b/fail2ban/server/failmanager.py @@ -24,11 +24,12 @@ __author__ = "Cyril Jaquier" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -from faildata import FailData -from ticket import FailTicket from threading import Lock import logging +from fail2ban.server.faildata import FailData +from fail2ban.server.ticket import FailTicket + # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/server/filter.py b/fail2ban/server/filter.py index aa534b73..d2ec1356 100644 --- a/fail2ban/server/filter.py +++ b/fail2ban/server/filter.py @@ -21,18 +21,18 @@ __author__ = "Cyril Jaquier and Fail2Ban Contributors" __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2011-2013 Yaroslav Halchenko" __license__ = "GPL" -from failmanager import FailManagerEmpty -from failmanager import FailManager -from ticket import FailTicket -from jailthread import JailThread -from datedetector import DateDetector -from datetemplate import DatePatternRegex, DateISO8601, DateEpoch, DateTai64n -from mytime import MyTime -from failregex import FailRegex, Regex, RegexException -from action import Action - import logging, re, os, fcntl, time, sys, locale, codecs +from fail2ban.server.failmanager import FailManagerEmpty +from fail2ban.server.failmanager import FailManager +from fail2ban.server.ticket import FailTicket +from fail2ban.server.jailthread import JailThread +from fail2ban.server.datedetector import DateDetector +from fail2ban.server.datetemplate import DatePatternRegex, DateISO8601, DateEpoch, DateTai64n +from fail2ban.server.mytime import MyTime +from fail2ban.server.failregex import FailRegex, Regex, RegexException +from fail2ban.server.action import Action + # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/server/filtergamin.py b/fail2ban/server/filtergamin.py index b48bdd3c..73834522 100644 --- a/fail2ban/server/filtergamin.py +++ b/fail2ban/server/filtergamin.py @@ -23,11 +23,13 @@ __author__ = "Cyril Jaquier, Yaroslav Halchenko" __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2012 Yaroslav Halchenko" __license__ = "GPL" -from failmanager import FailManagerEmpty -from filter import FileFilter -from mytime import MyTime +import time, logging, fcntl -import time, logging, gamin, fcntl +import gamin + +from fail2ban.server.failmanager import FailManagerEmpty +from fail2ban.server.filter import FileFilter +from fail2ban.server.mytime import MyTime # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/server/filterpoll.py b/fail2ban/server/filterpoll.py index 7fba65e1..54eea52a 100644 --- a/fail2ban/server/filterpoll.py +++ b/fail2ban/server/filterpoll.py @@ -24,12 +24,12 @@ __author__ = "Cyril Jaquier, Yaroslav Halchenko" __copyright__ = "Copyright (c) 2004 Cyril Jaquier; 2012 Yaroslav Halchenko" __license__ = "GPL" -from failmanager import FailManagerEmpty -from filter import FileFilter -from mytime import MyTime - import time, logging, os +from fail2ban.server.failmanager import FailManagerEmpty +from fail2ban.server.filter import FileFilter +from fail2ban.server.mytime import MyTime + # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/server/filterpyinotify.py b/fail2ban/server/filterpyinotify.py index 8a83e13a..68b0bd5e 100644 --- a/fail2ban/server/filterpyinotify.py +++ b/fail2ban/server/filterpyinotify.py @@ -24,13 +24,12 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2011-2012 Lee Clemens, 2012 Y __license__ = "GPL" import time, logging, pyinotify - from distutils.version import LooseVersion from os.path import dirname, sep as pathsep -from failmanager import FailManagerEmpty -from filter import FileFilter -from mytime import MyTime +from fail2ban.server.failmanager import FailManagerEmpty +from fail2ban.server.filter import FileFilter +from fail2ban.server.mytime import MyTime if not hasattr(pyinotify, '__version__') \ diff --git a/fail2ban/server/filtersystemd.py b/fail2ban/server/filtersystemd.py index 180cb84b..1843b5ad 100644 --- a/fail2ban/server/filtersystemd.py +++ b/fail2ban/server/filtersystemd.py @@ -29,9 +29,9 @@ from systemd import journal if LooseVersion(getattr(journal, '__version__', "0")) < '204': raise ImportError("Fail2Ban requires systemd >= 204") -from failmanager import FailManagerEmpty -from filter import JournalFilter -from mytime import MyTime +from fail2ban.server.failmanager import FailManagerEmpty +from fail2ban.server.filter import JournalFilter +from fail2ban.server.mytime import MyTime # Gets the instance of the logger. diff --git a/fail2ban/server/jail.py b/fail2ban/server/jail.py index c4e091fe..83012075 100644 --- a/fail2ban/server/jail.py +++ b/fail2ban/server/jail.py @@ -25,7 +25,7 @@ __license__ = "GPL" import Queue, logging -from actions import Actions +from fail2ban.server.actions import Actions # Gets the instance of the logger. logSys = logging.getLogger(__name__) diff --git a/fail2ban/server/jails.py b/fail2ban/server/jails.py index 12569d7f..07580b2e 100644 --- a/fail2ban/server/jails.py +++ b/fail2ban/server/jails.py @@ -21,11 +21,11 @@ __author__ = "Cyril Jaquier, Yaroslav Halchenko" __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2013- Yaroslav Halchenko" __license__ = "GPL" -from fail2ban.exceptions import DuplicateJailException, UnknownJailException - -from jail import Jail from threading import Lock +from fail2ban.exceptions import DuplicateJailException, UnknownJailException +from fail2ban.server.jail import Jail + ## # Handles the jails. # diff --git a/fail2ban/server/server.py b/fail2ban/server/server.py index 08e41003..805a52e0 100644 --- a/fail2ban/server/server.py +++ b/fail2ban/server/server.py @@ -25,15 +25,16 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" from threading import Lock, RLock -from jails import Jails -from filter import FileFilter, JournalFilter -from transmitter import Transmitter -from asyncserver import AsyncServer -from asyncserver import AsyncServerException -from database import Fail2BanDb -from fail2ban import version import logging, logging.handlers, sys, os, signal +from fail2ban.server.jails import Jails +from fail2ban.server.filter import FileFilter, JournalFilter +from fail2ban.server.transmitter import Transmitter +from fail2ban.server.asyncserver import AsyncServer +from fail2ban.server.asyncserver import AsyncServerException +from fail2ban.server.database import Fail2BanDb +from fail2ban import version + # Gets the instance of the logger. logSys = logging.getLogger(__name__)