summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-08-12 16:27:00 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-08-12 16:27:00 +0200
commit59f17d2835691553f783da75ad599ccaf2d7354d (patch)
tree9647bcfc2a0aee3b97f69d8e088cec916159d844
parent200ba8fe4dab5884ab0b3818c6678ad9745bdd7e (diff)
downloadpykolab-59f17d2835691553f783da75ad599ccaf2d7354d.tar.gz
Don't use domains.values(), we need only the first value of the tuple(s) of primary and secondary domain name spaces.
-rw-r--r--kolabd/__init__.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/kolabd/__init__.py b/kolabd/__init__.py
index df92138..f9bbeed 100644
--- a/kolabd/__init__.py
+++ b/kolabd/__init__.py
@@ -268,17 +268,22 @@ class KolabDaemon(object):
time.sleep(5)
continue
- # domains now is a list of tuples, we want the primary_domains
+ # domains now is a list of tuples in the format of
+ # ('primary',[secondaries]), we want the primary_domains
primary_domains = []
- for primary_domain in list(set(domains.values())):
- primary_domain = primary_auth.domain_naming_context(primary_domain)
- if not primary_domain == None:
- primary_domains.append(primary_domain)
+ for primary_domain, secondaries in domains:
+ domain_base_dn = primary_auth.domain_naming_context(primary_domain)
+
+ if not domain_base_dn == None:
+ if not domain_base_dn in primary_domains):
+ primary_domains.append(domain_base_dn)
# Now we can check if any changes happened.
added_domains = []
removed_domains = []
+ # Combine the domains from LDAP with the domain processes
+ # accounted for locally.
all_domains = set(primary_domains + domain_auth.keys())
for domain in all_domains:
@@ -311,6 +316,7 @@ class KolabDaemon(object):
for domain in added_domains:
domain_auth[domain] = Process(domain)
domain_auth[domain].start()
+
# Pause or hammer your LDAP server to death
if len(added_domains) >= 5:
time.sleep(10)