Branch 'pykolab-0.6' - kolabd/__init__.py

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Tue Feb 11 13:13:48 CET 2014


 kolabd/__init__.py |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 7416e1b1c34919dad5629fdb98f3a340f5c8c618
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Tue Feb 11 13:12:58 2014 +0100

    Avoid connection errors being fatal.
    Sleep and continue should we have an empty list of domains

diff --git a/kolabd/__init__.py b/kolabd/__init__.py
index 3f43872..5b3c5fa 100644
--- a/kolabd/__init__.py
+++ b/kolabd/__init__.py
@@ -220,6 +220,15 @@ class KolabDaemon(object):
         while 1:
             primary_auth = Auth(primary_domain)
 
+            connected = False
+            while not connected:
+                try:
+                    connected = primary_auth.connect()
+                except Exception, errmsg:
+                    connected = False
+                    log.error(_("Could not connect to LDAP, is it running?"))
+                    time.sleep(5)
+
             log.debug(_("Listing domains..."), level=5)
 
             start = time.time()
@@ -230,6 +239,11 @@ class KolabDaemon(object):
                 time.sleep(60)
                 continue
 
+            if isinstance(domains, list) and len(domains) < 1:
+                log.error(_("No domains. Not syncing"))
+                time.sleep(5)
+                continue
+
             # domains now is a list of tuples, we want the primary_domains
             primary_domains = []
             for primary_domain in list(set(domains.values())):




More information about the commits mailing list