mirror of https://github.com/fail2ban/fail2ban
RF: Replace old fashioned "except E , e" with "except E as e" (Closes #1537)
0.10 specific
supplement to b875e51cd7
in master AKA 0.9
pull/1541/head
parent
adeb6e94a5
commit
87acd7a0fc
|
@ -171,7 +171,7 @@ after = 1.conf
|
||||||
parser, i = self._getSharedSCPWI(resource)
|
parser, i = self._getSharedSCPWI(resource)
|
||||||
if not i:
|
if not i:
|
||||||
return []
|
return []
|
||||||
except UnicodeDecodeError, e:
|
except UnicodeDecodeError as e:
|
||||||
logSys.error("Error decoding config file '%s': %s" % (resource, e))
|
logSys.error("Error decoding config file '%s': %s" % (resource, e))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
|
@ -228,7 +228,7 @@ class ConfigReaderUnshared(SafeConfigParserWithIncludes):
|
||||||
if not pOptions is None and optname in pOptions:
|
if not pOptions is None and optname in pOptions:
|
||||||
continue
|
continue
|
||||||
values[optname] = v
|
values[optname] = v
|
||||||
except NoSectionError, e:
|
except NoSectionError as e:
|
||||||
if shouldExist:
|
if shouldExist:
|
||||||
raise
|
raise
|
||||||
# No "Definition" section or wrong basedir
|
# No "Definition" section or wrong basedir
|
||||||
|
|
|
@ -381,7 +381,7 @@ class Fail2banClient(Fail2banCmdLine, Thread):
|
||||||
elif not cmd == "":
|
elif not cmd == "":
|
||||||
try:
|
try:
|
||||||
self.__processCommand(shlex.split(cmd))
|
self.__processCommand(shlex.split(cmd))
|
||||||
except Exception, e: # pragma: no cover
|
except Exception as e: # pragma: no cover
|
||||||
if self._conf["verbose"] > 1:
|
if self._conf["verbose"] > 1:
|
||||||
logSys.exception(e)
|
logSys.exception(e)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -245,7 +245,7 @@ class Fail2banCmdLine():
|
||||||
ret = self.configurator.getOptions(jail)
|
ret = self.configurator.getOptions(jail)
|
||||||
self.configurator.convertToProtocol()
|
self.configurator.convertToProtocol()
|
||||||
stream = self.configurator.getConfigStream()
|
stream = self.configurator.getConfigStream()
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
logSys.error("Failed during configuration: %s" % e)
|
logSys.error("Failed during configuration: %s" % e)
|
||||||
ret = False
|
ret = False
|
||||||
return ret, stream
|
return ret, stream
|
||||||
|
|
|
@ -335,7 +335,7 @@ class Fail2banRegex(object):
|
||||||
if ret is not None:
|
if ret is not None:
|
||||||
found = True
|
found = True
|
||||||
regex = self._ignoreregex[ret].inc()
|
regex = self._ignoreregex[ret].inc()
|
||||||
except RegexException, e:
|
except RegexException as e:
|
||||||
output( e )
|
output( e )
|
||||||
return False
|
return False
|
||||||
return found
|
return found
|
||||||
|
@ -352,7 +352,7 @@ class Fail2banRegex(object):
|
||||||
regex = self._failregex[match[0]]
|
regex = self._failregex[match[0]]
|
||||||
regex.inc()
|
regex.inc()
|
||||||
regex.appendIP(match)
|
regex.appendIP(match)
|
||||||
except RegexException, e:
|
except RegexException as e:
|
||||||
output( e )
|
output( e )
|
||||||
return False
|
return False
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
@ -514,7 +514,7 @@ class Fail2banRegex(object):
|
||||||
output( "Use log file : %s" % cmd_log )
|
output( "Use log file : %s" % cmd_log )
|
||||||
output( "Use encoding : %s" % self.encoding )
|
output( "Use encoding : %s" % self.encoding )
|
||||||
test_lines = self.file_lines_gen(hdlr)
|
test_lines = self.file_lines_gen(hdlr)
|
||||||
except IOError, e:
|
except IOError as e:
|
||||||
output( e )
|
output( e )
|
||||||
return False
|
return False
|
||||||
elif cmd_log == "systemd-journal": # pragma: no cover
|
elif cmd_log == "systemd-journal": # pragma: no cover
|
||||||
|
|
|
@ -200,7 +200,7 @@ class Fail2banServer(Fail2banCmdLine):
|
||||||
exit(-1)
|
exit(-1)
|
||||||
logSys.debug('Starting server done')
|
logSys.debug('Starting server done')
|
||||||
|
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
if self._conf["verbose"] > 1:
|
if self._conf["verbose"] > 1:
|
||||||
logSys.exception(e)
|
logSys.exception(e)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -176,7 +176,7 @@ class JailReader(ConfigReader):
|
||||||
self.__actions.append(action)
|
self.__actions.append(action)
|
||||||
else:
|
else:
|
||||||
raise AttributeError("Unable to read action")
|
raise AttributeError("Unable to read action")
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
logSys.error("Error in action definition " + act)
|
logSys.error("Error in action definition " + act)
|
||||||
logSys.debug("Caught exception: %s" % (e,))
|
logSys.debug("Caught exception: %s" % (e,))
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -284,7 +284,7 @@ class CommandAction(ActionBase):
|
||||||
res &= self.executeCmd(startCmd6, self.timeout)
|
res &= self.executeCmd(startCmd6, self.timeout)
|
||||||
if not res:
|
if not res:
|
||||||
raise RuntimeError("Error starting action %s/%s" % (self._jail, self._name,))
|
raise RuntimeError("Error starting action %s/%s" % (self._jail, self._name,))
|
||||||
except ValueError, e:
|
except ValueError as e:
|
||||||
raise RuntimeError("Error starting action %s/%s: %r" % (self._jail, self._name, e))
|
raise RuntimeError("Error starting action %s/%s: %r" % (self._jail, self._name, e))
|
||||||
|
|
||||||
def ban(self, aInfo):
|
def ban(self, aInfo):
|
||||||
|
|
|
@ -42,7 +42,7 @@ if sys.version_info >= (3,):
|
||||||
try:
|
try:
|
||||||
x = json.dumps(x, ensure_ascii=False).encode(
|
x = json.dumps(x, ensure_ascii=False).encode(
|
||||||
locale.getpreferredencoding(), 'replace')
|
locale.getpreferredencoding(), 'replace')
|
||||||
except Exception, e: # pragma: no cover
|
except Exception as e: # pragma: no cover
|
||||||
logSys.error('json dumps failed: %s', e)
|
logSys.error('json dumps failed: %s', e)
|
||||||
x = '{}'
|
x = '{}'
|
||||||
return x
|
return x
|
||||||
|
@ -51,7 +51,7 @@ if sys.version_info >= (3,):
|
||||||
try:
|
try:
|
||||||
x = json.loads(x.decode(
|
x = json.loads(x.decode(
|
||||||
locale.getpreferredencoding(), 'replace'))
|
locale.getpreferredencoding(), 'replace'))
|
||||||
except Exception, e: # pragma: no cover
|
except Exception as e: # pragma: no cover
|
||||||
logSys.error('json loads failed: %s', e)
|
logSys.error('json loads failed: %s', e)
|
||||||
x = {}
|
x = {}
|
||||||
return x
|
return x
|
||||||
|
@ -70,7 +70,7 @@ else:
|
||||||
try:
|
try:
|
||||||
x = json.dumps(_normalize(x), ensure_ascii=False).decode(
|
x = json.dumps(_normalize(x), ensure_ascii=False).decode(
|
||||||
locale.getpreferredencoding(), 'replace')
|
locale.getpreferredencoding(), 'replace')
|
||||||
except Exception, e: # pragma: no cover
|
except Exception as e: # pragma: no cover
|
||||||
logSys.error('json dumps failed: %s', e)
|
logSys.error('json dumps failed: %s', e)
|
||||||
x = '{}'
|
x = '{}'
|
||||||
return x
|
return x
|
||||||
|
@ -79,7 +79,7 @@ else:
|
||||||
try:
|
try:
|
||||||
x = _normalize(json.loads(x.decode(
|
x = _normalize(json.loads(x.decode(
|
||||||
locale.getpreferredencoding(), 'replace')))
|
locale.getpreferredencoding(), 'replace')))
|
||||||
except Exception, e: # pragma: no cover
|
except Exception as e: # pragma: no cover
|
||||||
logSys.error('json loads failed: %s', e)
|
logSys.error('json loads failed: %s', e)
|
||||||
x = {}
|
x = {}
|
||||||
return x
|
return x
|
||||||
|
@ -176,7 +176,7 @@ class Fail2BanDb(object):
|
||||||
|
|
||||||
logSys.info(
|
logSys.info(
|
||||||
"Connected to fail2ban persistent database '%s'", filename)
|
"Connected to fail2ban persistent database '%s'", filename)
|
||||||
except sqlite3.OperationalError, e:
|
except sqlite3.OperationalError as e:
|
||||||
logSys.error(
|
logSys.error(
|
||||||
"Error connecting to fail2ban persistent database '%s': %s",
|
"Error connecting to fail2ban persistent database '%s': %s",
|
||||||
filename, e.args[0])
|
filename, e.args[0])
|
||||||
|
|
|
@ -113,7 +113,7 @@ class Filter(JailThread):
|
||||||
logSys.warning(
|
logSys.warning(
|
||||||
"Mutliline regex set for jail '%s' "
|
"Mutliline regex set for jail '%s' "
|
||||||
"but maxlines not greater than 1")
|
"but maxlines not greater than 1")
|
||||||
except RegexException, e:
|
except RegexException as e:
|
||||||
logSys.error(e)
|
logSys.error(e)
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
@ -146,7 +146,7 @@ class Filter(JailThread):
|
||||||
try:
|
try:
|
||||||
regex = Regex(value)
|
regex = Regex(value)
|
||||||
self.__ignoreRegex.append(regex)
|
self.__ignoreRegex.append(regex)
|
||||||
except RegexException, e:
|
except RegexException as e:
|
||||||
logSys.error(e)
|
logSys.error(e)
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
@ -583,7 +583,7 @@ class Filter(JailThread):
|
||||||
failRegex.getMatchedLines(), fail])
|
failRegex.getMatchedLines(), fail])
|
||||||
if not checkAllRegex:
|
if not checkAllRegex:
|
||||||
break
|
break
|
||||||
except RegexException, e: # pragma: no cover - unsure if reachable
|
except RegexException as e: # pragma: no cover - unsure if reachable
|
||||||
logSys.error(e)
|
logSys.error(e)
|
||||||
return failList
|
return failList
|
||||||
|
|
||||||
|
@ -729,15 +729,15 @@ class FileFilter(Filter):
|
||||||
try:
|
try:
|
||||||
has_content = log.open()
|
has_content = log.open()
|
||||||
# see http://python.org/dev/peps/pep-3151/
|
# see http://python.org/dev/peps/pep-3151/
|
||||||
except IOError, e:
|
except IOError as e:
|
||||||
logSys.error("Unable to open %s" % filename)
|
logSys.error("Unable to open %s" % filename)
|
||||||
logSys.exception(e)
|
logSys.exception(e)
|
||||||
return False
|
return False
|
||||||
except OSError, e: # pragma: no cover - requires race condition to tigger this
|
except OSError as e: # pragma: no cover - requires race condition to tigger this
|
||||||
logSys.error("Error opening %s" % filename)
|
logSys.error("Error opening %s" % filename)
|
||||||
logSys.exception(e)
|
logSys.exception(e)
|
||||||
return False
|
return False
|
||||||
except Exception, e: # pragma: no cover - Requires implemention error in FileContainer to generate
|
except Exception as e: # pragma: no cover - Requires implemention error in FileContainer to generate
|
||||||
logSys.error("Internal error in FileContainer open method - please report as a bug to https://github.com/fail2ban/fail2ban/issues")
|
logSys.error("Internal error in FileContainer open method - please report as a bug to https://github.com/fail2ban/fail2ban/issues")
|
||||||
logSys.exception(e)
|
logSys.exception(e)
|
||||||
return False
|
return False
|
||||||
|
@ -750,7 +750,7 @@ class FileFilter(Filter):
|
||||||
# initial seek to start time using half-interval search algorithm:
|
# initial seek to start time using half-interval search algorithm:
|
||||||
try:
|
try:
|
||||||
self.seekToTime(log, startTime)
|
self.seekToTime(log, startTime)
|
||||||
except Exception, e: # pragma: no cover
|
except Exception as e: # pragma: no cover
|
||||||
logSys.error("Error during seek to start time in \"%s\"", filename)
|
logSys.error("Error during seek to start time in \"%s\"", filename)
|
||||||
raise
|
raise
|
||||||
logSys.exception(e)
|
logSys.exception(e)
|
||||||
|
|
|
@ -150,7 +150,7 @@ class FilterPoll(FileFilter):
|
||||||
logSys.debug("%s has been modified", filename)
|
logSys.debug("%s has been modified", filename)
|
||||||
self.__prevStats[filename] = stats
|
self.__prevStats[filename] = stats
|
||||||
return True
|
return True
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
logSys.error("Unable to get stat on %s because of: %s"
|
logSys.error("Unable to get stat on %s because of: %s"
|
||||||
% (filename, e))
|
% (filename, e))
|
||||||
self.__file404Cnt[filename] += 1
|
self.__file404Cnt[filename] += 1
|
||||||
|
|
|
@ -45,7 +45,7 @@ if not hasattr(pyinotify, '__version__') \
|
||||||
try:
|
try:
|
||||||
manager = pyinotify.WatchManager()
|
manager = pyinotify.WatchManager()
|
||||||
del manager
|
del manager
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
raise ImportError("Pyinotify is probably not functional on this system: %s"
|
raise ImportError("Pyinotify is probably not functional on this system: %s"
|
||||||
% str(e))
|
% str(e))
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ class DNSUtils:
|
||||||
ip = IPAddr(result[4][0])
|
ip = IPAddr(result[4][0])
|
||||||
if ip.isValid:
|
if ip.isValid:
|
||||||
ips.append(ip)
|
ips.append(ip)
|
||||||
except socket.error, e:
|
except socket.error as e:
|
||||||
# todo: make configurable the expired time of cache entry:
|
# todo: make configurable the expired time of cache entry:
|
||||||
logSys.warning("Unable to find a corresponding IP address for %s: %s", dns, e)
|
logSys.warning("Unable to find a corresponding IP address for %s: %s", dns, e)
|
||||||
ips = list()
|
ips = list()
|
||||||
|
@ -86,7 +86,7 @@ class DNSUtils:
|
||||||
# retrieve name
|
# retrieve name
|
||||||
try:
|
try:
|
||||||
v = socket.gethostbyaddr(ip)[0]
|
v = socket.gethostbyaddr(ip)[0]
|
||||||
except socket.error, e:
|
except socket.error as e:
|
||||||
logSys.debug("Unable to find a name for the IP %s: %s", ip, e)
|
logSys.debug("Unable to find a name for the IP %s: %s", ip, e)
|
||||||
v = None
|
v = None
|
||||||
DNSUtils.CACHE_ipToName.set(ip, v)
|
DNSUtils.CACHE_ipToName.set(ip, v)
|
||||||
|
|
|
@ -109,7 +109,7 @@ class Jail(object):
|
||||||
logSys.info("Initiated %r backend" % b)
|
logSys.info("Initiated %r backend" % b)
|
||||||
self.__actions = Actions(self)
|
self.__actions = Actions(self)
|
||||||
return # we are done
|
return # we are done
|
||||||
except ImportError, e: # pragma: no cover
|
except ImportError as e: # pragma: no cover
|
||||||
# Log debug if auto, but error if specific
|
# Log debug if auto, but error if specific
|
||||||
logSys.log(
|
logSys.log(
|
||||||
logging.DEBUG if backend == "auto" else logging.ERROR,
|
logging.DEBUG if backend == "auto" else logging.ERROR,
|
||||||
|
|
|
@ -138,7 +138,7 @@ class Server:
|
||||||
pidFile = open(pidfile, 'w')
|
pidFile = open(pidfile, 'w')
|
||||||
pidFile.write("%s\n" % os.getpid())
|
pidFile.write("%s\n" % os.getpid())
|
||||||
pidFile.close()
|
pidFile.close()
|
||||||
except IOError, e:
|
except IOError as e:
|
||||||
logSys.error("Unable to create PID file: %s" % e)
|
logSys.error("Unable to create PID file: %s" % e)
|
||||||
|
|
||||||
# Start the communication
|
# Start the communication
|
||||||
|
@ -146,13 +146,13 @@ class Server:
|
||||||
try:
|
try:
|
||||||
self.__asyncServer = AsyncServer(self.__transm)
|
self.__asyncServer = AsyncServer(self.__transm)
|
||||||
self.__asyncServer.start(sock, force)
|
self.__asyncServer.start(sock, force)
|
||||||
except AsyncServerException, e:
|
except AsyncServerException as e:
|
||||||
logSys.error("Could not start server: %s", e)
|
logSys.error("Could not start server: %s", e)
|
||||||
# Removes the PID file.
|
# Removes the PID file.
|
||||||
try:
|
try:
|
||||||
logSys.debug("Remove PID file %s" % pidfile)
|
logSys.debug("Remove PID file %s" % pidfile)
|
||||||
os.remove(pidfile)
|
os.remove(pidfile)
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
logSys.error("Unable to remove PID file: %s" % e)
|
logSys.error("Unable to remove PID file: %s" % e)
|
||||||
logSys.info("Exiting Fail2ban")
|
logSys.info("Exiting Fail2ban")
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ class Server:
|
||||||
# the child gets a new PID, making it impossible for its PID to equal its
|
# the child gets a new PID, making it impossible for its PID to equal its
|
||||||
# PGID.
|
# PGID.
|
||||||
pid = os.fork()
|
pid = os.fork()
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
return (False, (e.errno, e.strerror)) # ERROR (return a tuple)
|
return (False, (e.errno, e.strerror)) # ERROR (return a tuple)
|
||||||
|
|
||||||
if pid == 0: # The first child.
|
if pid == 0: # The first child.
|
||||||
|
@ -625,7 +625,7 @@ class Server:
|
||||||
# fork guarantees that the child is no longer a session leader, thus
|
# fork guarantees that the child is no longer a session leader, thus
|
||||||
# preventing the daemon from ever acquiring a controlling terminal.
|
# preventing the daemon from ever acquiring a controlling terminal.
|
||||||
pid = os.fork() # Fork a second child.
|
pid = os.fork() # Fork a second child.
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
return (False, (e.errno, e.strerror)) # ERROR (return a tuple)
|
return (False, (e.errno, e.strerror)) # ERROR (return a tuple)
|
||||||
|
|
||||||
if (pid == 0): # The second child.
|
if (pid == 0): # The second child.
|
||||||
|
|
|
@ -56,7 +56,7 @@ class Transmitter:
|
||||||
try:
|
try:
|
||||||
ret = self.__commandHandler(command)
|
ret = self.__commandHandler(command)
|
||||||
ack = 0, ret
|
ack = 0, ret
|
||||||
except Exception, e:
|
except Exception as e:
|
||||||
logSys.warning("Command %r has failed. Received %r"
|
logSys.warning("Command %r has failed. Received %r"
|
||||||
% (command, e))
|
% (command, e))
|
||||||
ack = 1, e
|
ack = 1, e
|
||||||
|
|
|
@ -421,7 +421,7 @@ class FilterReaderTest(unittest.TestCase):
|
||||||
# from testcase01
|
# from testcase01
|
||||||
filterReader.get('Definition', 'failregex')
|
filterReader.get('Definition', 'failregex')
|
||||||
filterReader.get('Definition', 'ignoreregex')
|
filterReader.get('Definition', 'ignoreregex')
|
||||||
except Exception, e: # pragma: no cover - failed if reachable
|
except Exception as e: # pragma: no cover - failed if reachable
|
||||||
self.fail('unexpected options after readexplicit: %s' % (e))
|
self.fail('unexpected options after readexplicit: %s' % (e))
|
||||||
|
|
||||||
|
|
||||||
|
@ -771,7 +771,7 @@ filter = testfilter1
|
||||||
def testLogPathSystemdBackend(self):
|
def testLogPathSystemdBackend(self):
|
||||||
try: # pragma: systemd no cover
|
try: # pragma: systemd no cover
|
||||||
from ..server.filtersystemd import FilterSystemd
|
from ..server.filtersystemd import FilterSystemd
|
||||||
except Exception, e: # pragma: no cover
|
except Exception as e: # pragma: no cover
|
||||||
raise unittest.SkipTest("systemd python interface not available")
|
raise unittest.SkipTest("systemd python interface not available")
|
||||||
self._testLogPath(backend='systemd')
|
self._testLogPath(backend='systemd')
|
||||||
self._testLogPath(backend='systemd[journalflags=2]')
|
self._testLogPath(backend='systemd[journalflags=2]')
|
||||||
|
|
|
@ -102,7 +102,7 @@ def testSampleRegexsFactory(name, basedir):
|
||||||
if jsonREMatch:
|
if jsonREMatch:
|
||||||
try:
|
try:
|
||||||
faildata = json.loads(jsonREMatch.group(1))
|
faildata = json.loads(jsonREMatch.group(1))
|
||||||
except ValueError, e:
|
except ValueError as e:
|
||||||
raise ValueError("%s: %s:%i" %
|
raise ValueError("%s: %s:%i" %
|
||||||
(e, logFile.filename(), logFile.filelineno()))
|
(e, logFile.filename(), logFile.filelineno()))
|
||||||
line = next(logFile)
|
line = next(logFile)
|
||||||
|
|
|
@ -1111,7 +1111,7 @@ class ServerConfigReaderTests(LogCaptureTestCase):
|
||||||
# command to server, use cmdHandler direct instead of `transm.proceed(cmd)`:
|
# command to server, use cmdHandler direct instead of `transm.proceed(cmd)`:
|
||||||
try:
|
try:
|
||||||
cmdHandler(cmd)
|
cmdHandler(cmd)
|
||||||
except Exception, e: # pragma: no cover
|
except Exception as e: # pragma: no cover
|
||||||
self.fail("Command %r has failed. Received %r" % (cmd, e))
|
self.fail("Command %r has failed. Received %r" % (cmd, e))
|
||||||
|
|
||||||
# jails = server._Server__jails
|
# jails = server._Server__jails
|
||||||
|
|
|
@ -433,13 +433,13 @@ def gatherTests(regexps=None, opts=None):
|
||||||
raise ImportError('Skip, fast: %s, no_gamin: %s' % (unittest.F2B.fast, unittest.F2B.no_gamin))
|
raise ImportError('Skip, fast: %s, no_gamin: %s' % (unittest.F2B.fast, unittest.F2B.no_gamin))
|
||||||
from ..server.filtergamin import FilterGamin
|
from ..server.filtergamin import FilterGamin
|
||||||
filters.append(FilterGamin)
|
filters.append(FilterGamin)
|
||||||
except ImportError, e: # pragma: no cover
|
except ImportError as e: # pragma: no cover
|
||||||
logSys.warning("Skipping gamin backend testing. Got exception '%s'" % e)
|
logSys.warning("Skipping gamin backend testing. Got exception '%s'" % e)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from ..server.filterpyinotify import FilterPyinotify
|
from ..server.filterpyinotify import FilterPyinotify
|
||||||
filters.append(FilterPyinotify)
|
filters.append(FilterPyinotify)
|
||||||
except ImportError, e: # pragma: no cover
|
except ImportError as e: # pragma: no cover
|
||||||
logSys.warning("I: Skipping pyinotify backend testing. Got exception '%s'" % e)
|
logSys.warning("I: Skipping pyinotify backend testing. Got exception '%s'" % e)
|
||||||
|
|
||||||
for Filter_ in filters:
|
for Filter_ in filters:
|
||||||
|
@ -448,7 +448,7 @@ def gatherTests(regexps=None, opts=None):
|
||||||
try: # pragma: systemd no cover
|
try: # pragma: systemd no cover
|
||||||
from ..server.filtersystemd import FilterSystemd
|
from ..server.filtersystemd import FilterSystemd
|
||||||
tests.addTest(unittest.makeSuite(filtertestcase.get_monitor_failures_journal_testcase(FilterSystemd)))
|
tests.addTest(unittest.makeSuite(filtertestcase.get_monitor_failures_journal_testcase(FilterSystemd)))
|
||||||
except ImportError, e: # pragma: no cover
|
except ImportError as e: # pragma: no cover
|
||||||
logSys.warning("I: Skipping systemd backend testing. Got exception '%s'" % e)
|
logSys.warning("I: Skipping systemd backend testing. Got exception '%s'" % e)
|
||||||
|
|
||||||
# Server test for logging elements which break logging used to support
|
# Server test for logging elements which break logging used to support
|
||||||
|
|
Loading…
Reference in New Issue