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

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