From af4b13115b91726a854e70eb68d91cf8f5eeedf5 Mon Sep 17 00:00:00 2001 From: sebres Date: Tue, 1 Sep 2015 20:10:47 +0200 Subject: [PATCH] code and config review after rebase to current master --- fail2ban/server/server.py | 5 ++--- fail2ban/tests/filtertestcase.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fail2ban/server/server.py b/fail2ban/server/server.py index 8dc1b761c..ca06973d2 100644 --- a/fail2ban/server/server.py +++ b/fail2ban/server/server.py @@ -327,9 +327,8 @@ class Server: def isAlive(self, jailnum=None): if jailnum is not None and len(self.__jails) != jailnum: return 0 - for j in self.__jails: - j = self.__jails[j] - if not j.isAlive(): + for jail in self.__jails.values(): + if not jail.isAlive(): return 0 return 1 diff --git a/fail2ban/tests/filtertestcase.py b/fail2ban/tests/filtertestcase.py index 7557f5200..ab0f0462e 100644 --- a/fail2ban/tests/filtertestcase.py +++ b/fail2ban/tests/filtertestcase.py @@ -1231,9 +1231,9 @@ class DNSUtilsNetworkTests(unittest.TestCase): self.assertEqual(res, []) def testIpToName(self): + unittest.F2B.SkipIfNoNetwork() res = DNSUtils.ipToName('8.8.4.4') self.assertEqual(res, 'google-public-dns-b.google.com') - unittest.F2B.SkipIfNoNetwork() # invalid ip (TEST-NET-1 according to RFC 5737) res = DNSUtils.ipToName('192.0.2.0') self.assertEqual(res, None)