1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-22 02:17:26 +00:00

Fixed E711 (none-comparison)

This commit is contained in:
Teal Dulcet 2023-12-22 07:20:28 -08:00 committed by Joshua Tauberer
parent 541f31b1ba
commit 99d3929f99
2 changed files with 6 additions and 6 deletions

View File

@ -223,7 +223,7 @@ def build_zone(domain, domain_properties, additional_records, env, is_zone=True)
subdomain_qname = subdomain[0:-len("." + domain)] subdomain_qname = subdomain[0:-len("." + domain)]
subzone = build_zone(subdomain, domain_properties, additional_records, env, is_zone=False) subzone = build_zone(subdomain, domain_properties, additional_records, env, is_zone=False)
for child_qname, child_rtype, child_value, child_explanation in subzone: for child_qname, child_rtype, child_value, child_explanation in subzone:
if child_qname == None: if child_qname is None:
child_qname = subdomain_qname child_qname = subdomain_qname
else: else:
child_qname += "." + subdomain_qname child_qname += "." + subdomain_qname
@ -968,7 +968,7 @@ def set_custom_dns_record(qname, rtype, value, action, env):
# Drop this record. # Drop this record.
made_change = True made_change = True
continue continue
if value == None and (_qname, _rtype) == (qname, rtype): if value is None and (_qname, _rtype) == (qname, rtype):
# Drop all qname-rtype records. # Drop all qname-rtype records.
made_change = True made_change = True
continue continue
@ -999,7 +999,7 @@ def get_secondary_dns(custom_dns, mode=None):
if qname != '_secondary_nameserver': continue if qname != '_secondary_nameserver': continue
for hostname in value.split(" "): for hostname in value.split(" "):
hostname = hostname.strip() hostname = hostname.strip()
if mode == None: if mode is None:
# Just return the setting. # Just return the setting.
values.append(hostname) values.append(hostname)
continue continue
@ -1090,7 +1090,7 @@ def build_recommended_dns(env):
# expand qnames # expand qnames
for i in range(len(records)): for i in range(len(records)):
qname = domain if records[i][0] == None else records[i][0] + "." + domain qname = domain if records[i][0] is None else records[i][0] + "." + domain
records[i] = { records[i] = {
"qname": qname, "qname": qname,

View File

@ -688,7 +688,7 @@ def check_mail_domain(domain, env, output):
# of priority-host pairs. # of priority-host pairs.
mxhost = mx.split('; ')[0].split(' ')[1] mxhost = mx.split('; ')[0].split(' ')[1]
if mxhost == None: if mxhost is None:
# A missing MX record is okay on the primary hostname because # A missing MX record is okay on the primary hostname because
# the primary hostname's A record (the MX fallback) is... itself, # the primary hostname's A record (the MX fallback) is... itself,
# which is what we want the MX to be. # which is what we want the MX to be.
@ -701,7 +701,7 @@ def check_mail_domain(domain, env, output):
else: else:
domain_a = query_dns(domain, "A", nxdomain=None) domain_a = query_dns(domain, "A", nxdomain=None)
primary_a = query_dns(env['PRIMARY_HOSTNAME'], "A", nxdomain=None) primary_a = query_dns(env['PRIMARY_HOSTNAME'], "A", nxdomain=None)
if domain_a != None and domain_a == primary_a: if domain_a is not None and domain_a == primary_a:
output.print_ok("Domain's email is directed to this domain. [{} has no MX record but its A record is OK]".format(domain)) output.print_ok("Domain's email is directed to this domain. [{} has no MX record but its A record is OK]".format(domain))
else: else:
output.print_error("""This domain's DNS MX record is not set. It should be '{}'. Mail will not output.print_error("""This domain's DNS MX record is not set. It should be '{}'. Mail will not