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

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