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