Module: check_mk
Branch: master
Commit: bbb853703df5eed60134ea9c7d69e6b92d5418b3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bbb853703df5ee…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Aug 29 16:34:59 2017 +0200
Improved recent implicit connect/disconnect fix
Change-Id: I3b2c0b963d261f310761f0a65c55f00d873482f9
---
web/plugins/userdb/ldap.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 8973be6..4fb8dee 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -567,7 +567,7 @@ class LDAPUserConnector(UserConnector):
# In some environments, the connection to the LDAP server does not seem to
# be as stable as it is needed. So we try to repeat the query for three times.
# -> Don't retry when implicit connect is disabled
- tries_left = 2 if implicit_connect else 0
+ tries_left = 2
success = False
last_exc = None
while not success:
@@ -601,7 +601,7 @@ class LDAPUserConnector(UserConnector):
'within the ldap or adapt the limit
settings of the LDAP server.'))
except (ldap.SERVER_DOWN, ldap.TIMEOUT, MKLDAPException), e:
last_exc = e
- if tries_left:
+ if implicit_connect and tries_left:
self.log(' Received %r. Retrying with clean connection...' %
e)
self.disconnect()
time.sleep(0.5)