Blame SOURCES/0001-DNS-install-check-Fix-overlapping-DNS-zone-from-the-master-itself_2c2cef7_rhbz#1784003.patch

a6e2d8
From 2c2cef7063315766d893b275185b422be3f3c019 Mon Sep 17 00:00:00 2001
a6e2d8
From: Thomas Woerner <twoerner@redhat.com>
a6e2d8
Date: Dec 16 2019 20:37:17 +0000
a6e2d8
Subject: DNS install check: Fix overlapping DNS zone from the master itself
a6e2d8
a6e2d8
a6e2d8
The change to allow overlapping zone to be from the master itself has
a6e2d8
introduced two issues: The check for the master itself should only executed
a6e2d8
if options.force and options.allow_zone_overlap are both false and the
a6e2d8
reverse zone check later on was still handling ValueError instead of
a6e2d8
dnsutil.DNSZoneAlreadyExists.
a6e2d8
a6e2d8
Both issues have been fixed and the deployment with existing name servers
a6e2d8
is properly working again.
a6e2d8
a6e2d8
Fixes: https://pagure.io/freeipa/issue/8150
a6e2d8
Signed-off-by: Thomas Woerner <twoerner@redhat.com>
a6e2d8
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
a6e2d8
a6e2d8
---
a6e2d8
a6e2d8
diff --git a/ipaserver/install/dns.py b/ipaserver/install/dns.py
a6e2d8
index 36ba6f8..9f08e86 100644
a6e2d8
--- a/ipaserver/install/dns.py
a6e2d8
+++ b/ipaserver/install/dns.py
a6e2d8
@@ -135,15 +135,15 @@ def install_check(standalone, api, replica, options, hostname):
a6e2d8
                 logger.warning("%s Please make sure that the domain is "
a6e2d8
                                "properly delegated to this IPA server.",
a6e2d8
                                e)
a6e2d8
-
a6e2d8
-            hst = dnsutil.DNSName(hostname).make_absolute().to_text()
a6e2d8
-            if hst not in e.kwargs['ns']:
a6e2d8
-                raise ValueError(str(e))
a6e2d8
+            else:
a6e2d8
+                hst = dnsutil.DNSName(hostname).make_absolute().to_text()
a6e2d8
+                if hst not in e.kwargs['ns']:
a6e2d8
+                    raise ValueError(str(e))
a6e2d8
 
a6e2d8
     for reverse_zone in options.reverse_zones:
a6e2d8
         try:
a6e2d8
             dnsutil.check_zone_overlap(reverse_zone)
a6e2d8
-        except ValueError as e:
a6e2d8
+        except dnsutil.DNSZoneAlreadyExists as e:
a6e2d8
             if options.force or options.allow_zone_overlap:
a6e2d8
                 logger.warning('%s', str(e))
a6e2d8
             else:
a6e2d8