Files
freeipa/ipapython/platform/fedora16/instances/utils.py
Krzysztof Klimonda bbb86e36aa move check_inst out of bindinstance.py
create a new platform utils module which imports a proper implementation
from platform.PLATFORM.instances.utils. Move the current check_inst to the
fedora16 package and create debian implementation which uses dpkg-query
to check for bind9 and bind-dyndb-ldap packages.
2012-04-17 00:26:03 +02:00

29 lines
1.0 KiB
Python

import os
import ipautil
def bind_check_installation(unattended):
has_bind = True
# So far this file is always present in both RHEL5 and Fedora if all the necessary
# bind packages are installed (RHEL5 requires also the pkg: caching-nameserver)
if not os.path.exists('/etc/named.rfc1912.zones'):
print "BIND was not found on this system"
print "Please install the 'bind' package and start the installation again"
has_bind = False
# Also check for the LDAP BIND plug-in
if not os.path.exists('/usr/lib/bind/ldap.so') and \
not os.path.exists('/usr/lib64/bind/ldap.so'):
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
if not unattended and os.path.exists('/etc/named.conf'):
msg = "Existing BIND configuration detected, overwrite?"
return ipautil.user_input(msg, False)
return True