From c95b87c13ceda7e08f0152982590eb93562f6861 Mon Sep 17 00:00:00 2001 From: Steven Hiscocks Date: Sun, 21 Apr 2013 11:21:06 +0100 Subject: [PATCH] ENH: Use os.path.join for filter/action config readers --- fail2ban/client/actionreader.py | 4 ++-- fail2ban/client/filterreader.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fail2ban/client/actionreader.py b/fail2ban/client/actionreader.py index b9211a1b..70c5b3a7 100644 --- a/fail2ban/client/actionreader.py +++ b/fail2ban/client/actionreader.py @@ -27,7 +27,7 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -import logging +import logging, os from configreader import ConfigReader, OptionConfigReader # Gets the instance of the logger. @@ -44,7 +44,7 @@ class ActionReader(OptionConfigReader): ] def read(self): - return ConfigReader.read(self, "action.d/" + self._file) + return ConfigReader.read(self, os.path.join("action.d", self._file)) def convert(self): head = ["set", self._name] diff --git a/fail2ban/client/filterreader.py b/fail2ban/client/filterreader.py index 09f0e6a8..19a3f0f3 100644 --- a/fail2ban/client/filterreader.py +++ b/fail2ban/client/filterreader.py @@ -27,7 +27,7 @@ __date__ = "$Date$" __copyright__ = "Copyright (c) 2004 Cyril Jaquier" __license__ = "GPL" -import logging +import logging, os from configreader import ConfigReader, OptionConfigReader # Gets the instance of the logger. @@ -41,7 +41,7 @@ class FilterReader(OptionConfigReader): ] def read(self): - return ConfigReader.read(self, "filter.d/" + self._file) + return ConfigReader.read(self, os.path.join("filter.d", self._file)) def convert(self): stream = list()