certificates: fix edge case where None is returned, triggering 'NoneType has no attribute get'

This commit is contained in:
Alexandre Aubin 2022-01-17 22:06:49 +01:00
parent ac5718c666
commit 019839dbf9

View file

@ -860,14 +860,14 @@ def _check_domain_is_ready_for_ACME(domain):
if is_yunohost_dyndns_domain(parent_domain):
record_name = "@"
A_record_status = dnsrecords.get("data").get(f"A:{record_name}")
AAAA_record_status = dnsrecords.get("data").get(f"AAAA:{record_name}")
A_record_status = dnsrecords.get("data", {}).get(f"A:{record_name}")
AAAA_record_status = dnsrecords.get("data", {}).get(f"AAAA:{record_name}")
# Fallback to wildcard in case no result yet for the DNS name?
if not A_record_status:
A_record_status = dnsrecords.get("data").get("A:*")
A_record_status = dnsrecords.get("data", {}).get("A:*")
if not AAAA_record_status:
AAAA_record_status = dnsrecords.get("data").get("AAAA:*")
AAAA_record_status = dnsrecords.get("data", {}).get("AAAA:*")
if (
not httpreachable