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():
|
with self.error_handler():
|
||||||
self._flush_schema()
|
self._flush_schema()
|
||||||
self.conn.unbind_s()
|
self._conn.unbind_s()
|
||||||
|
|
||||||
def make_dn_from_attr(self, attr, value, parent_dn=None):
|
def make_dn_from_attr(self, attr, value, parent_dn=None):
|
||||||
"""
|
"""
|
||||||
|
@ -196,8 +196,9 @@ class ldap2(LDAPClient, CrudBackend):
|
|||||||
def destroy_connection(self):
|
def destroy_connection(self):
|
||||||
"""Disconnect from LDAP server."""
|
"""Disconnect from LDAP server."""
|
||||||
try:
|
try:
|
||||||
self.unbind()
|
if self._conn is not None:
|
||||||
LDAPClient._disconnect(self)
|
self.unbind()
|
||||||
|
LDAPClient._disconnect(self)
|
||||||
except errors.PublicError:
|
except errors.PublicError:
|
||||||
# ignore when trying to unbind multiple times
|
# ignore when trying to unbind multiple times
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user