From 73a06d55a8ed5996e959952a616c9d9a8b209dc7 Mon Sep 17 00:00:00 2001 From: sebres Date: Fri, 10 Oct 2014 18:50:24 +0200 Subject: [PATCH] reset share/cache storage (if we use 'reload' in client with interactive mode) --- bin/fail2ban-client | 1 + fail2ban/client/configurator.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/fail2ban-client b/bin/fail2ban-client index 89e0a903..0c6999c1 100755 --- a/bin/fail2ban-client +++ b/bin/fail2ban-client @@ -409,6 +409,7 @@ class Fail2banClient: # TODO: get away from stew of return codes and exception # handling -- handle via exceptions try: + self.__configurator.Reload() self.__configurator.readAll() ret = self.__configurator.getOptions(jail) self.__configurator.convertToProtocol() diff --git a/fail2ban/client/configurator.py b/fail2ban/client/configurator.py index b3ddc5d0..8667501c 100644 --- a/fail2ban/client/configurator.py +++ b/fail2ban/client/configurator.py @@ -39,9 +39,14 @@ class Configurator: # always share all config readers: if share_config is None: share_config = dict() + self.__share_config = share_config self.__fail2ban = Fail2banReader(share_config=share_config) self.__jails = JailsReader(force_enable=force_enable, share_config=share_config) - + + def Reload(self): + # clear all shared handlers: + self.__share_config.clear() + def setBaseDir(self, folderName): self.__fail2ban.setBaseDir(folderName) self.__jails.setBaseDir(folderName)