summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kolabd/__init__.py14
1 files changed, 14 insertions, 0 deletions
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())):