ipaldap: merge simple_bind into LDAPClient

* Use LDAPClient.simple_bind instead of extra call to IPAdmin.do_simple_bind
* Rename binddn to bind_dn
* Rename bindpw to bind_password
* Explicitly specify bind_dn in all calls

https://fedorahosted.org/freeipa/ticket/6461

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Tomas Krizek
2016-10-05 17:42:32 +02:00
committed by Martin Basti
parent 5760b7e983
commit de58a5c605
13 changed files with 44 additions and 36 deletions

View File

@@ -51,8 +51,6 @@ from .common import BaseServer
if six.PY3:
unicode = str
DIRMAN_DN = DN(('cn', 'directory manager'))
def get_dirman_password():
return installutils.read_password("Directory Manager (existing master)",
@@ -637,7 +635,7 @@ def install_check(installer):
replman = None
try:
# Try out the password
conn.connect(bind_dn=DIRMAN_DN, bind_pw=config.dirman_password,
conn.connect(bind_dn=ipaldap.DIRMAN_DN, bind_pw=config.dirman_password,
tls_cacertfile=cafile)
replman = ReplicationManager(config.realm_name,
config.master_host_name,
@@ -791,7 +789,7 @@ def install(installer):
remote_api = installer._remote_api
conn = remote_api.Backend.ldap2
try:
conn.connect(bind_dn=DIRMAN_DN, bind_pw=config.dirman_password,
conn.connect(bind_dn=ipaldap.DIRMAN_DN, bind_pw=config.dirman_password,
tls_cacertfile=cafile)
# Install CA cert so that we can do SSL connections with ldap