From f4b396219cbf76e3785f0b24dc130b590a2d2464 Mon Sep 17 00:00:00 2001 From: Tagadda <36127788+Tagadda@users.noreply.github.com> Date: Tue, 11 Oct 2022 18:06:57 +0000 Subject: [PATCH] Clarify conditions --- src/diagnosers/14-ports.py | 4 ++-- src/diagnosers/21-web.py | 2 +- src/dns.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/diagnosers/14-ports.py b/src/diagnosers/14-ports.py index 2d7eee717..1483dbb96 100644 --- a/src/diagnosers/14-ports.py +++ b/src/diagnosers/14-ports.py @@ -47,7 +47,7 @@ class MyDiagnoser(Diagnoser): ipversions = [] ipv4 = Diagnoser.get_cached_report("ip", item={"test": "ipv4"}) or {} - if ipv4.get("status") == "SUCCESS" or not settings_get("dns_exposure") == "ipv6": + if ipv4.get("status") == "SUCCESS" or settings_get("dns_exposure") != "ipv6": ipversions.append(4) # To be discussed: we could also make this check dependent on the @@ -121,7 +121,7 @@ class MyDiagnoser(Diagnoser): for record in dnsrecords.get("items", []) ) - if failed == 4 and not settings_get("dns_exposure") == "ipv6" or ipv6_is_important(): + if failed == 4 and settings_get("dns_exposure") != "ipv6" or ipv6_is_important(): yield dict( meta={"port": port}, data={ diff --git a/src/diagnosers/21-web.py b/src/diagnosers/21-web.py index eaac0d25f..f62d182bc 100644 --- a/src/diagnosers/21-web.py +++ b/src/diagnosers/21-web.py @@ -77,7 +77,7 @@ class MyDiagnoser(Diagnoser): ipversions = [] ipv4 = Diagnoser.get_cached_report("ip", item={"test": "ipv4"}) or {} - if ipv4.get("status") == "SUCCESS" and not settings_get("dns_exposure") == "ipv6": + if ipv4.get("status") == "SUCCESS" and settings_get("dns_exposure") != "ipv6": ipversions.append(4) # To be discussed: we could also make this check dependent on the diff --git a/src/dns.py b/src/dns.py index 31c91d590..a007f69be 100644 --- a/src/dns.py +++ b/src/dns.py @@ -186,7 +186,7 @@ def _build_dns_conf(base_domain, include_empty_AAAA_if_no_ipv6=False): ########################### # Basic ipv4/ipv6 records # ########################### - if ipv4 and not settings_get("dns_exposure") == "ipv6": + if ipv4 and settings_get("dns_exposure") != "ipv6": basic.append([basename, ttl, "A", ipv4]) if ipv6: