mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
allow to call ldap2.destroy_connection multiple times
A regression fix. Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
This commit is contained in:
parent
b88f5333ec
commit
7d10547ae3
@ -1089,7 +1089,7 @@ class LDAPClient(object):
|
||||
"""
|
||||
with self.error_handler():
|
||||
self._flush_schema()
|
||||
self.conn.unbind_s()
|
||||
self._conn.unbind_s()
|
||||
|
||||
def make_dn_from_attr(self, attr, value, parent_dn=None):
|
||||
"""
|
||||
|
@ -196,8 +196,9 @@ class ldap2(LDAPClient, CrudBackend):
|
||||
def destroy_connection(self):
|
||||
"""Disconnect from LDAP server."""
|
||||
try:
|
||||
self.unbind()
|
||||
LDAPClient._disconnect(self)
|
||||
if self._conn is not None:
|
||||
self.unbind()
|
||||
LDAPClient._disconnect(self)
|
||||
except errors.PublicError:
|
||||
# ignore when trying to unbind multiple times
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user