summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/dns.py
diff options
context:
space:
mode:
authorDavid Kupka <dkupka@redhat.com>2015-12-17 16:16:09 +0100
committerMartin Basti <mbasti@redhat.com>2015-12-22 16:04:14 +0100
commit8ad39a974fd4e1cc6fd2a09b1d9d0c8724983b15 (patch)
treeecbbe46c1f970bb733b0e4be54314ef9f49724e0 /ipaserver/install/dns.py
parent91913c5ba7c380fe6456e1c3e35fcbfbecef5ff1 (diff)
downloadfreeipa-8ad39a974fd4e1cc6fd2a09b1d9d0c8724983b15.tar.gz
freeipa-8ad39a974fd4e1cc6fd2a09b1d9d0c8724983b15.tar.xz
freeipa-8ad39a974fd4e1cc6fd2a09b1d9d0c8724983b15.zip
ipa-dns-install: Do not check for zone overlap when DNS installed.
When DNS is already installed somewhere in topology we should not check for zone overlap because it would always say that we are overlapping our own domain. ipa-replica-install already does that but ipa-dns-install did not. https://fedorahosted.org/freeipa/ticket/5564 Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
Diffstat (limited to 'ipaserver/install/dns.py')
-rw-r--r--ipaserver/install/dns.py24
1 files changed, 8 insertions, 16 deletions
diff --git a/ipaserver/install/dns.py b/ipaserver/install/dns.py
index 763b2aca4..9a2fde29f 100644
--- a/ipaserver/install/dns.py
+++ b/ipaserver/install/dns.py
@@ -99,20 +99,7 @@ def _disable_dnssec():
conn.update_entry(entry)
-def check_dns_enabled(api):
- try:
- api.Backend.rpcclient.connect()
- result = api.Backend.rpcclient.forward(
- 'dns_is_enabled',
- version=u'2.112', # All the way back to 3.0 servers
- )
- return result['result']
- finally:
- if api.Backend.rpcclient.isconnected():
- api.Backend.rpcclient.disconnect()
-
-
-def install_check(standalone, replica, options, hostname):
+def install_check(standalone, api, replica, options, hostname):
global ip_addresses
global reverse_zones
fstore = sysrestore.FileStore(paths.SYSRESTORE)
@@ -121,8 +108,13 @@ def install_check(standalone, replica, options, hostname):
raise RuntimeError("Integrated DNS requires '%s' package" %
constants.IPA_DNS_PACKAGE_NAME)
- # when installing first replica with DNS we need to check zone overlap
- if not replica or not check_dns_enabled(api):
+ # when installing first DNS instance we need to check zone overlap
+ if replica or standalone:
+ already_enabled = api.Command.dns_is_enabled()['result']
+ else:
+ already_enabled = False
+
+ if not already_enabled:
domain = dnsutil.DNSName(util.normalize_zone(api.env.domain))
print("Checking DNS domain %s, please wait ..." % domain)
try: