[ldap] don't refuse to start if ldap is unreachable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 27 Oct 2010 08:51:50 +0200
changeset 6653 52d1568af412
parent 6652 592c88c8f018
child 6654 18d159a2d1ba
[ldap] don't refuse to start if ldap is unreachable
server/sources/ldapuser.py
--- a/server/sources/ldapuser.py	Tue Oct 26 20:22:30 2010 +0200
+++ b/server/sources/ldapuser.py	Wed Oct 27 08:51:50 2010 +0200
@@ -266,7 +266,10 @@
     def get_connection(self):
         """open and return a connection to the source"""
         if self._conn is None:
-            self._connect()
+            try:
+                self._connect()
+            except:
+                self.exception('cant connect to ldap')
         return ConnectionWrapper(self._conn)
 
     def authenticate(self, session, login, password=None, **kwargs):