From e584ab66ac06c4679261e518ea0e6a94cb45f979 Mon Sep 17 00:00:00 2001 From: Steven Hiscocks Date: Fri, 10 May 2013 10:27:26 +0100 Subject: [PATCH] BF: Avoid setting of log encoding for systemd backend --- fail2ban/server/server.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fail2ban/server/server.py b/fail2ban/server/server.py index b496b6ad..c411820c 100644 --- a/fail2ban/server/server.py +++ b/fail2ban/server/server.py @@ -177,7 +177,7 @@ class Server: def delLogPath(self, name, fileName): filter_ = self.__jails.getFilter(name) if isinstance(filter_, FileFilter): - self.__jails.getFilter(name).delLogPath(fileName) + filter_.delLogPath(fileName) def getLogPath(self, name): filter_ = self.__jails.getFilter(name) @@ -207,10 +207,14 @@ class Server: return [] def setLogEncoding(self, name, encoding): - return self.__jails.getFilter(name).setLogEncoding(encoding) + filter_ = self.__jails.getFilter(name) + if isinstance(filter_, FileFilter): + filter_.setLogEncoding(encoding) def getLogEncoding(self, name): - return self.__jails.getFilter(name).getLogEncoding() + filter_ = self.__jails.getFilter(name) + if isinstance(filter_, FileFilter): + return filter_.getLogEncoding() def setFindTime(self, name, value): self.__jails.getFilter(name).setFindTime(value)