From a2f624338289d8dc6887457f346b79e254e9394f Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Wed, 12 Jan 2022 13:34:18 +0100 Subject: [PATCH] remove the error variable --- core/admin/start.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/core/admin/start.py b/core/admin/start.py index 9a958c4a..f3e153f5 100755 --- a/core/admin/start.py +++ b/core/admin/start.py @@ -33,17 +33,15 @@ def test_DNS(): nameservers = resolver.nameservers for ns in nameservers: resolver.nameservers=[ns] - error = True - while error: + while True: try: result = resolver.query('example.org', dns.rdatatype.A, dns.rdataclass.IN, lifetime=10) - if not result.response.flags & dns.flags.AD: - log.critical("Your DNS resolver at %s isn't doing DNSSEC validation; Please use another resolver or enable unbound via https://setup.mailu.io.", ns) - else: - error = False - continue except Exception as e: log.critical("Your DNS resolver at %s is not working (%s). Please use another resolver or enable unbound via https://setup.mailu.io.", ns, e); + elif result.response.flags & dns.flags.AD: + break + else: + log.critical("Your DNS resolver at %s isn't doing DNSSEC validation; Please use another resolver or enable unbound via https://setup.mailu.io.", ns) time.sleep(5) test_DNS()