mirror of https://github.com/fail2ban/fail2ban
Merge branch '0.10' into 0.11
commit
a462966cf6
|
@ -79,3 +79,10 @@ logging.handlers.SysLogHandler.priority_map['NOTICE'] = 'notice'
|
|||
from time import strptime
|
||||
# strptime thread safety hack-around - http://bugs.python.org/issue7980
|
||||
strptime("2012", "%Y")
|
||||
|
||||
# short names for pure numeric log-level ("Level 25" could be truncated by short formats):
|
||||
def _init():
|
||||
for i in xrange(50):
|
||||
if logging.getLevelName(i).startswith('Level'):
|
||||
logging.addLevelName(i, '#%02d-Lev.' % i)
|
||||
_init()
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -343,7 +343,7 @@ class CommandAction(ActionBase):
|
|||
if wrp == 'ignore': # ignore (filter) dynamic parameters
|
||||
return
|
||||
elif wrp == 'str2seconds':
|
||||
value = str(MyTime.str2seconds(value))
|
||||
value = MyTime.str2seconds(value)
|
||||
# parameters changed - clear properties and substitution cache:
|
||||
self.__properties = None
|
||||
self.__substCache.clear()
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue