diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install index eebc9e2ad..ee7ebe0bd 100755 --- a/install/tools/ipa-dns-install +++ b/install/tools/ipa-dns-install @@ -134,7 +134,7 @@ def main(): options.setup_ca = None # must be None to enable autodetection - dns_installer.install_check(True, False, options, hostname=api.env.host) + dns_installer.install_check(True, api, False, options, hostname=api.env.host) dns_installer.install(True, False, options) # Restart http instance to make sure that python-dns has the right resolver 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: diff --git a/ipaserver/install/server/install.py b/ipaserver/install/server/install.py index fbb20b02a..831985d61 100644 --- a/ipaserver/install/server/install.py +++ b/ipaserver/install/server/install.py @@ -691,7 +691,7 @@ def install_check(installer): ca.install_check(False, None, options) if options.setup_dns: - dns.install_check(False, False, options, host_name) + dns.install_check(False, api, False, options, host_name) ip_addresses = dns.ip_addresses else: ip_addresses = get_server_ip_address(host_name, diff --git a/ipaserver/install/server/replicainstall.py b/ipaserver/install/server/replicainstall.py index 4e6abde0e..63fe02b5c 100644 --- a/ipaserver/install/server/replicainstall.py +++ b/ipaserver/install/server/replicainstall.py @@ -653,7 +653,7 @@ def install_check(installer): conn.disconnect() if options.setup_dns: - dns.install_check(False, True, options, config.host_name) + dns.install_check(False, remote_api, True, options, config.host_name) config.ips = dns.ip_addresses else: config.ips = installutils.get_server_ip_address( @@ -1175,7 +1175,7 @@ def promote_check(installer): conn.disconnect() if options.setup_dns: - dns.install_check(False, True, options, config.host_name) + dns.install_check(False, remote_api, True, options, config.host_name) else: config.ips = installutils.get_server_ip_address( config.host_name, not installer.interactive,