mirror of https://github.com/fail2ban/fail2ban
ENH: rudimentary __repr__ for Filter and Jail + moved usedns into set method
otherwise usedns is way too noisy, especially within fail2ban-regexpull/38/head
parent
25f1e8d98c
commit
2245ff5b41
|
@ -73,9 +73,12 @@ class Filter(JailThread):
|
|||
|
||||
self.dateDetector = DateDetector()
|
||||
self.dateDetector.addDefaultTemplate()
|
||||
logSys.debug("Created Filter")
|
||||
logSys.debug("Created %s" % self)
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(%r)" % (self.__class__.__name__, self.jail)
|
||||
|
||||
##
|
||||
# Add a regular expression which matches the failure.
|
||||
#
|
||||
|
@ -146,6 +149,7 @@ class Filter(JailThread):
|
|||
# @param value the usedns mode
|
||||
|
||||
def setUseDns(self, value):
|
||||
logSys.debug("Setting usedns = %s for %s" % (value, self))
|
||||
self.__useDns = value
|
||||
|
||||
##
|
||||
|
@ -586,7 +590,6 @@ class DNSUtils:
|
|||
if useDns == "no":
|
||||
return None
|
||||
else:
|
||||
logSys.debug("usedns = %s" % useDns)
|
||||
ipList = list()
|
||||
# Search for plain IP
|
||||
plainIP = DNSUtils.searchIP(text)
|
||||
|
|
|
@ -42,6 +42,9 @@ class Jail:
|
|||
logSys.info("Creating new jail '%s'" % self.__name)
|
||||
self._setBackend(backend)
|
||||
|
||||
def __repr__(self):
|
||||
return "%s(%r)" % (self.__class__.__name__, self.__name)
|
||||
|
||||
def _setBackend(self, backend):
|
||||
backend = backend.lower() # to assure consistent matching
|
||||
|
||||
|
|
Loading…
Reference in New Issue