summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-10-06 09:38:26 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-10-06 09:38:26 +0200
commit764103053f068e0b25aae272dd455351ab71c1e9 (patch)
tree4d2094afa6c67b3dece1ac0dd758d42cafe733b8
parentec80886e7ff71613b5c48d01168e008351a05e00 (diff)
downloadpykolab-764103053f068e0b25aae272dd455351ab71c1e9.tar.gz
T1414: Set LDAP TIMEOUT option only on "immediate" connection
Summary: Fixes T1414. Shouldn't we handle ldap.TIMEOUT exception in authenticate()? Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Subscribers: pokorra, thozie Maniphest Tasks: T1414 Differential Revision: https://git.kolab.org/D208
-rw-r--r--pykolab/auth/ldap/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index f3a38fc..62f765a 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -404,7 +404,7 @@ class LDAP(pykolab.base.Base):
return retval
- def connect(self, priv=None, immediate=True):
+ def connect(self, priv=None, immediate=False):
"""
Connect to the LDAP server through the uri configured.
"""
@@ -441,7 +441,8 @@ class LDAP(pykolab.base.Base):
retry_delay=retry_delay
)
- conn.set_option(ldap.OPT_TIMEOUT, 10)
+ if immediate:
+ conn.set_option(ldap.OPT_TIMEOUT, 10)
conn.protocol_version = 3
conn.supported_controls = []