summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-dns-install
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2010-03-24 15:51:31 +0100
committerRob Crittenden <rcritten@redhat.com>2010-04-19 11:27:10 -0400
commit3620135ec97c156b84a310cd423d5df52732b3f8 (patch)
tree665eb48ad333da90acf0313e0005877954e4b9f7 /install/tools/ipa-dns-install
parentcc336cf9c17283684df7b850e010d669122126a5 (diff)
downloadfreeipa-3620135ec97c156b84a310cd423d5df52732b3f8.tar.gz
freeipa-3620135ec97c156b84a310cd423d5df52732b3f8.tar.xz
freeipa-3620135ec97c156b84a310cd423d5df52732b3f8.zip
Use ldap2 instead of legacy LDAP code from v1 in installer scripts.
Diffstat (limited to 'install/tools/ipa-dns-install')
-rwxr-xr-xinstall/tools/ipa-dns-install18
1 files changed, 9 insertions, 9 deletions
diff --git a/install/tools/ipa-dns-install b/install/tools/ipa-dns-install
index 0656794cd..3413312ae 100755
--- a/install/tools/ipa-dns-install
+++ b/install/tools/ipa-dns-install
@@ -22,13 +22,12 @@
from optparse import OptionParser
import traceback
-from ipaserver import ipaldap
+from ipaserver.plugins.ldap2 import ldap2
from ipaserver.install import bindinstance, ntpinstance
from ipaserver.install.installutils import *
from ipapython import version
from ipapython import ipautil, sysrestore
-from ipalib import api, util
-import ldap
+from ipalib import api, errors, util
def parse_options():
parser = OptionParser(version=version.VERSION)
@@ -134,14 +133,15 @@ def main():
dm_password = options.dm_password
# Try out the password
+ ldapuri = 'ldap://%s' % api.env.host
try:
- conn = ipaldap.IPAdmin(api.env.host)
- conn.do_simple_bind(bindpw=dm_password)
- conn.unbind()
- except (ldap.CONNECT_ERROR, ldap.SERVER_DOWN), e:
- sys.exit("\nUnable to connect to LDAP server %s" % api.env.host)
- except ldap.INVALID_CREDENTIALS, e :
+ conn = ldap2(shared_instance=False, ldap_uri=ldapuri)
+ conn.connect(bind_dn='cn=directory manager', bind_pw=dm_password)
+ conn.disconnect()
+ except errors.ACIError:
sys.exit("\nThe password provided is incorrect for LDAP server %s" % api.env.host)
+ except errors.LDAPError:
+ sys.exit("\nUnable to connect to LDAP server %s" % api.env.host)
conf_ntp = ntpinstance.NTPInstance(fstore).is_enabled()