diff options
author | Jan Cholasta <jcholast@redhat.com> | 2015-04-08 11:31:15 +0000 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-04-16 06:58:31 +0000 |
commit | e1f7bcfbea13f4fa67222d009092c556b017fcd4 (patch) | |
tree | fd3a0cfc8a77ec556c0f4ef38c1412dc507cf4d2 /ipaserver/plugins | |
parent | 32505157ea34bfc9f807ff7c8d3e5962f4581475 (diff) | |
download | freeipa-e1f7bcfbea13f4fa67222d009092c556b017fcd4.tar.gz freeipa-e1f7bcfbea13f4fa67222d009092c556b017fcd4.tar.xz freeipa-e1f7bcfbea13f4fa67222d009092c556b017fcd4.zip |
ldap: Use LDAPClient instead of IPASimpleLDAPObject in ldap2.modify_password
Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r-- | ipaserver/plugins/ldap2.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py index 1e103dcfb..9ab33e2f1 100644 --- a/ipaserver/plugins/ldap2.py +++ b/ipaserver/plugins/ldap2.py @@ -34,7 +34,7 @@ import krbV import ldap as _ldap from ipapython.dn import DN -from ipapython.ipaldap import SASL_GSSAPI, IPASimpleLDAPObject, LDAPClient +from ipapython.ipaldap import SASL_GSSAPI, LDAPClient try: @@ -471,11 +471,10 @@ class ldap2(LDAPClient, CrudBackend): pw = old_pass if (otp): pw = old_pass+otp - with self.error_handler(): - conn = IPASimpleLDAPObject( - self.ldap_uri, force_schema_updates=False) - conn.simple_bind_s(dn, pw) - conn.unbind_s() + + with LDAPClient(self.ldap_uri, force_schema_updates=False) as conn: + conn.simple_bind(dn, pw) + conn.unbind() with self.error_handler(): self.conn.passwd_s(dn, old_pass, new_pass) |