ipatests: fix ldap server url

master.external_hostname was used to construct ldap url
which caused ldappasswd utility to exit with error due to host name
mismatch in client certificate. master.hostname should be used instead
as this name is used to generate certificate.

Fixes https://pagure.io/freeipa/issue/7844

Signed-off-by: Sergey Orlov <sorlov@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Sergey Orlov 2019-01-22 15:24:05 +01:00 committed by Christian Heimes
parent 53e0b2255d
commit 20d8286b60

View File

@ -1488,7 +1488,7 @@ def ldappasswd_user_change(user, oldpw, newpw, master):
basedn = master.domain.basedn
userdn = "uid={},{},{}".format(user, container_user, basedn)
master_ldap_uri = "ldap://{}".format(master.external_hostname)
master_ldap_uri = "ldap://{}".format(master.hostname)
args = [paths.LDAPPASSWD, '-D', userdn, '-w', oldpw, '-a', oldpw,
'-s', newpw, '-x', '-ZZ', '-H', master_ldap_uri]
@ -1500,7 +1500,7 @@ def ldappasswd_sysaccount_change(user, oldpw, newpw, master):
basedn = master.domain.basedn
userdn = "uid={},{},{}".format(user, container_sysaccounts, basedn)
master_ldap_uri = "ldap://{}".format(master.external_hostname)
master_ldap_uri = "ldap://{}".format(master.hostname)
args = [paths.LDAPPASSWD, '-D', userdn, '-w', oldpw, '-a', oldpw,
'-s', newpw, '-x', '-ZZ', '-H', master_ldap_uri]