diff options
author | Pavel Zuna <pzuna@redhat.com> | 2010-04-27 16:35:07 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-04-27 16:29:36 -0400 |
commit | 44c18444935443e3ea1cb9bb6c543a436bc84cd8 (patch) | |
tree | 1e271127e5df547a4e972cdafd96f9019406e347 /install/tools/ipa-server-install | |
parent | 9dc7cf93387403a8b27ae223958d99c5fa127edd (diff) | |
download | freeipa-44c18444935443e3ea1cb9bb6c543a436bc84cd8.tar.gz freeipa-44c18444935443e3ea1cb9bb6c543a436bc84cd8.tar.xz freeipa-44c18444935443e3ea1cb9bb6c543a436bc84cd8.zip |
Replace a new instance of IPAdmin use in ipa-server-install.
Diffstat (limited to 'install/tools/ipa-server-install')
-rwxr-xr-x | install/tools/ipa-server-install | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install index c1035e98..5aed0437 100755 --- a/install/tools/ipa-server-install +++ b/install/tools/ipa-server-install @@ -483,15 +483,15 @@ def main(): if user_input("Do you want to remove old SRV and NS records?", False): dm_password = read_password("Directory Manager", confirm=False, validate=False) # 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) + except errors.ACIError: sys.exit("\nThe password provided is incorrect for LDAP server %s" % api.env.host) - + except errors.ExecutionError: + sys.exit("\nUnable to connect to LDAP server %s" % api.env.host) + conn.disconnect() return uninstall(not certs.ipa_self_signed(), dm_password) @@ -846,7 +846,10 @@ try: except SystemExit, e: sys.exit(e) except Exception, e: - message = "Unexpected error - see ipaserver-install.log for details:\n %s" % str(e) + if options.uninstall: + message = "Unexpected error - see ipaserver-uninstall.log for details:\n %s" % str(e) + else + message = "Unexpected error - see ipaserver-install.log for details:\n %s" % str(e) print message message = str(e) for str in traceback.format_tb(sys.exc_info()[2]): |