From 6d984717b5f743d836840d851b1d0814f3da842a Mon Sep 17 00:00:00 2001 From: sebres Date: Sat, 12 Dec 2015 15:46:45 +0100 Subject: [PATCH] ordered dict replaced with dict + change log entry fix # Conflicts: # fail2ban/server/filter.py --- ChangeLog | 5 +++-- fail2ban/server/filter.py | 7 +------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 225a8a8b..42fc0b38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,8 +59,9 @@ ver. 0.9.4 (2015/XX/XXX) - wanna-be-released rest api and web interface (gh-1223) * Add *_backend options for services to allow distros to set the default backend per service, set default to systemd for Fedora as appropriate - * small improvement for better handling of many log files (gh-1265) - Thanks @kshetragia + * Performance improvements while monitoring large number of files (gh-1265). + Use associative array (dict) for monitored log files to speed up lookup + operations. Thanks @kshetragia ver. 0.9.3 (2015/08/01) - lets-all-stay-friends ---------- diff --git a/fail2ban/server/filter.py b/fail2ban/server/filter.py index 8f4f602a..2b354f7a 100644 --- a/fail2ban/server/filter.py +++ b/fail2ban/server/filter.py @@ -38,11 +38,6 @@ from .failregex import FailRegex, Regex, RegexException from .action import CommandAction from ..helpers import getLogger -try: - from collections import OrderedDict -except ImportError: - OrderedDict = dict - # Gets the instance of the logger. logSys = getLogger(__name__) @@ -557,7 +552,7 @@ class FileFilter(Filter): def __init__(self, jail, **kwargs): Filter.__init__(self, jail, **kwargs) ## The log file path. - self.__logs = OrderedDict() + self.__logs = dict() self.setLogEncoding("auto") ##