diff --git a/fail2ban/helpers.py b/fail2ban/helpers.py index 49a5ca47c..c6da8f304 100644 --- a/fail2ban/helpers.py +++ b/fail2ban/helpers.py @@ -429,7 +429,7 @@ def substituteRecursiveTags(inptags, conditional='', m = tre_search(value, m.end()) continue # if calling map - be sure we've string: - if noRecRepl: repl = uni_string(repl) + if not isinstance(repl, basestring): repl = uni_string(repl) value = value.replace('<%s>' % rtag, repl) #logSys.log(5, 'value now: %s' % value) # increment reference count: diff --git a/fail2ban/server/action.py b/fail2ban/server/action.py index 10d1acd9d..ef953eff6 100644 --- a/fail2ban/server/action.py +++ b/fail2ban/server/action.py @@ -331,7 +331,7 @@ class CommandAction(ActionBase): if not name.startswith('_') and not self.__init and not callable(value): # special case for some parameters: if name in ('timeout', 'bantime'): - value = str(MyTime.str2seconds(value)) + value = MyTime.str2seconds(value) # parameters changed - clear properties and substitution cache: self.__properties = None self.__substCache.clear() diff --git a/fail2ban/tests/servertestcase.py b/fail2ban/tests/servertestcase.py index 425ab7577..610a1a5d2 100644 --- a/fail2ban/tests/servertestcase.py +++ b/fail2ban/tests/servertestcase.py @@ -661,11 +661,11 @@ class Transmitter(TransmitterBase): self.assertEqual( self.transm.proceed( ["set", self.jailName, "action", action, "timeout", "10"]), - (0, "10")) + (0, 10)) self.assertEqual( self.transm.proceed( ["get", self.jailName, "action", action, "timeout"]), - (0, "10")) + (0, 10)) self.assertEqual( self.transm.proceed(["set", self.jailName, "delaction", action]), (0, None))