summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2015-07-01 15:05:45 +0200
committerJan Cholasta <jcholast@redhat.com>2015-07-21 17:30:10 +0200
commit92828d3cf50e00fe75ebf3ec9e0edc8b9c8eae35 (patch)
tree8d1abd73e7a8069c47fe66ae76f691a6dd713809
parenta487e42d3fb71ceb3128fb9a2055a5586c4ed851 (diff)
downloadfreeipa-92828d3cf50e00fe75ebf3ec9e0edc8b9c8eae35.zip
freeipa-92828d3cf50e00fe75ebf3ec9e0edc8b9c8eae35.tar.gz
freeipa-92828d3cf50e00fe75ebf3ec9e0edc8b9c8eae35.tar.xz
DNS: check if DNS package is installed
Instead of separate checking of DNS required packages, we need just check if IPA DNS package is installed. https://fedorahosted.org/freeipa/ticket/4058 Reviewed-By: Martin Babinsky <mbabinsk@redhat.com> Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Tomas Babej <tbabej@redhat.com>
-rw-r--r--ipaplatform/base/constants.py2
-rw-r--r--ipaplatform/base/paths.py1
-rw-r--r--ipaplatform/rhel/constants.py2
-rw-r--r--ipaserver/install/bindinstance.py19
-rw-r--r--ipaserver/install/dns.py11
-rw-r--r--ipaserver/install/dnskeysyncinstance.py6
-rw-r--r--ipaserver/install/opendnssecinstance.py8
7 files changed, 10 insertions, 39 deletions
diff --git a/ipaplatform/base/constants.py b/ipaplatform/base/constants.py
index 7048505..cef829e 100644
--- a/ipaplatform/base/constants.py
+++ b/ipaplatform/base/constants.py
@@ -8,4 +8,4 @@ This base platform module exports platform dependant constants.
class BaseConstantsNamespace(object):
- pass
+ IPA_DNS_PACKAGE_NAME = "freeipa-server-dns"
diff --git a/ipaplatform/base/paths.py b/ipaplatform/base/paths.py
index 5756040..4c93c1f 100644
--- a/ipaplatform/base/paths.py
+++ b/ipaplatform/base/paths.py
@@ -218,6 +218,7 @@ class BasePathNamespace(object):
GROUPADD = "/usr/sbin/groupadd"
HTTPD = "/usr/sbin/httpd"
IPA_CLIENT_INSTALL = "/usr/sbin/ipa-client-install"
+ IPA_DNS_INSTALL = "/usr/sbin/ipa-dns-install"
SBIN_IPA_JOIN = "/usr/sbin/ipa-join"
IPA_REPLICA_CONNCHECK = "/usr/sbin/ipa-replica-conncheck"
IPA_RMKEYTAB = "/usr/sbin/ipa-rmkeytab"
diff --git a/ipaplatform/rhel/constants.py b/ipaplatform/rhel/constants.py
index eaca480..17abde1 100644
--- a/ipaplatform/rhel/constants.py
+++ b/ipaplatform/rhel/constants.py
@@ -11,6 +11,6 @@ from ipaplatform.redhat.constants import RedHatConstantsNamespace
class RHELConstantsNamespace(RedHatConstantsNamespace):
- pass
+ IPA_DNS_PACKAGE_NAME = "ipa-server-dns"
constants = RHELConstantsNamespace()
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index 2228342..9705e84 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -62,25 +62,8 @@ named_conf_arg_options_template_nonstr = "%(indent)s%(name)s %(value)s;\n"
named_conf_include_re = re.compile(r'\s*include\s+"(?P<path>)"\s*;')
named_conf_include_template = "include \"%(path)s\";\n"
-def check_inst(unattended):
- has_bind = True
- named = services.knownservices.named
- if not os.path.exists(named.get_binary_path()):
- print "BIND was not found on this system"
- print ("Please install the '%s' package and start the installation again"
- % named.get_package_name())
- has_bind = False
-
- # Also check for the LDAP BIND plug-in
- if not os.path.exists(paths.BIND_LDAP_SO) and \
- not os.path.exists(paths.BIND_LDAP_SO_64):
- print "The BIND LDAP plug-in was not found on this system"
- print "Please install the 'bind-dyndb-ldap' package and start the installation again"
- has_bind = False
-
- if not has_bind:
- return False
+def check_inst(unattended):
if not unattended and os.path.exists(NAMED_CONF):
msg = "Existing BIND configuration detected, overwrite?"
return ipautil.user_input(msg, False)
diff --git a/ipaserver/install/dns.py b/ipaserver/install/dns.py
index d22bce7..9430d18 100644
--- a/ipaserver/install/dns.py
+++ b/ipaserver/install/dns.py
@@ -9,6 +9,7 @@ from subprocess import CalledProcessError
from ipalib import api
from ipalib import errors
from ipaplatform.paths import paths
+from ipaplatform.constants import constants
from ipaplatform import services
from ipapython import ipautil
from ipapython import sysrestore
@@ -96,6 +97,10 @@ def install_check(standalone, replica, options, hostname):
global reverse_zones
fstore = sysrestore.FileStore(paths.SYSRESTORE)
+ if not ipautil.file_exists(paths.IPA_DNS_INSTALL):
+ raise RuntimeError("Integrated DNS requires '%s' package" %
+ constants.IPA_DNS_PACKAGE_NAME)
+
if standalone:
print "=============================================================================="
print "This program will setup DNS for the FreeIPA Server."
@@ -141,8 +146,7 @@ def install_check(standalone, replica, options, hostname):
sys.exit("Aborted")
# Check bind packages are installed
- if not (bindinstance.check_inst(options.unattended) and
- dnskeysyncinstance.check_inst()):
+ if not bindinstance.check_inst(options.unattended):
sys.exit("Aborting installation.")
if options.disable_dnssec_master:
@@ -177,9 +181,6 @@ def install_check(standalone, replica, options, hostname):
sys.exit("Only one DNSSEC key master is supported in current "
"version.")
- # check opendnssec packages are installed
- if not opendnssecinstance.check_inst():
- sys.exit("Aborting installation")
if options.kasp_db_file:
dnskeysyncd = services.service('ipa-dnskeysyncd')
diff --git a/ipaserver/install/dnskeysyncinstance.py b/ipaserver/install/dnskeysyncinstance.py
index eb6d07f..7d1351c 100644
--- a/ipaserver/install/dnskeysyncinstance.py
+++ b/ipaserver/install/dnskeysyncinstance.py
@@ -30,12 +30,6 @@ softhsm_token_label = u'ipaDNSSEC'
softhsm_slot = 0
replica_keylabel_template = u"dnssec-replica:%s"
-def check_inst():
- if not os.path.exists(paths.DNSSEC_KEYFROMLABEL):
- print ("Please install the 'bind-pkcs11-utils' package and start "
- "the installation again")
- return False
- return True
def dnssec_container_exists(fqdn, suffix, dm_password=None, ldapi=False,
realm=None, autobind=ipaldap.AUTOBIND_DISABLED):
diff --git a/ipaserver/install/opendnssecinstance.py b/ipaserver/install/opendnssecinstance.py
index d68691f..0f1af82 100644
--- a/ipaserver/install/opendnssecinstance.py
+++ b/ipaserver/install/opendnssecinstance.py
@@ -55,14 +55,6 @@ def get_dnssec_key_masters(conn):
return keymasters_list
-def check_inst():
- if not os.path.exists(paths.ODS_KSMUTIL):
- print ("Please install the 'opendnssec' package and start "
- "the installation again")
- return False
- return True
-
-
class OpenDNSSECInstance(service.Service):
def __init__(self, fstore=None, dm_password=None, ldapi=False,
start_tls=False, autobind=ipaldap.AUTOBIND_ENABLED):