summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins/ldap2.py
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2015-04-23 12:03:49 +0200
committerPetr Vobornik <pvoborni@redhat.com>2015-05-07 18:13:57 +0200
commit7d10547ae3098b96762846ff36e813042a503d59 (patch)
tree226c200c3495a7e38653f4d9a9344d04108278f2 /ipaserver/plugins/ldap2.py
parentb88f5333ec039cf8a40c0377323554a451730ac7 (diff)
downloadfreeipa-7d10547ae3098b96762846ff36e813042a503d59.tar.gz
freeipa-7d10547ae3098b96762846ff36e813042a503d59.tar.xz
freeipa-7d10547ae3098b96762846ff36e813042a503d59.zip
allow to call ldap2.destroy_connection multiple times
A regression fix. Reviewed-By: Nathaniel McCallum <npmccallum@redhat.com>
Diffstat (limited to 'ipaserver/plugins/ldap2.py')
-rw-r--r--ipaserver/plugins/ldap2.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py
index d1d966c59..36a6fedda 100644
--- a/ipaserver/plugins/ldap2.py
+++ b/ipaserver/plugins/ldap2.py
@@ -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