ipaserver/install/dns: handle SERVFAIL when checking reverse zone

systemd-resolved in Fedora 34+ returns SERVFAIL for reverse zone that
does not yet exist when we attempt to look it up before installation.
Assume that this is OK -- we are going to create the zone ourselves
during installation.

Fixes: https://pagure.io/freeipa/issue/8794

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
Alexander Bokovoy
2021-04-10 15:40:22 +03:00
committed by Florence Blanc-Renaud
parent 2832621512
commit 48ef179e23

View File

@@ -447,7 +447,13 @@ def check_zone_overlap(zone, raise_on_error=True):
except dns.exception.DNSException as e:
msg = ("DNS check for domain %s failed: %s." % (zone, e))
if raise_on_error:
raise ValueError(msg)
if isinstance(e, dns.resolver.NoNameservers):
# Show warning and continue in case we've got SERVFAIL
# because we are supposedly going to create this reverse zone
logger.warning('%s', msg)
return
else:
raise ValueError(msg)
else:
logger.warning('%s', msg)
return