summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorTimotheus Pokorra <tp@tbits.net>2015-04-20 13:22:29 +0200
committerTimotheus Pokorra <tp@tbits.net>2015-04-20 13:22:29 +0200
commit0c7325e65775e63ae79c11205220ab92b1c9342d (patch)
tree1e5970edda8a9bcd12e9dd236a1e85d23b348a75 /pykolab
parentd046fbc0b96e88e8db30e37aa590aa155731102e (diff)
downloadpykolab-0c7325e65775e63ae79c11205220ab92b1c9342d.tar.gz
fix kolab sync for multiple domains (#3197)
kolab sync needs to deal with multiple domains using a different db object for each domain.
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/auth/ldap/cache.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/pykolab/auth/ldap/cache.py b/pykolab/auth/ldap/cache.py
index 07c3d28..02c3831 100644
--- a/pykolab/auth/ldap/cache.py
+++ b/pykolab/auth/ldap/cache.py
@@ -52,7 +52,7 @@ log = pykolab.getLogger('pykolab.auth_cache')
metadata = MetaData()
-db = None
+db = {}
##
## Classes
@@ -165,8 +165,8 @@ def init_db(domain,reinit=False):
"""
global db
- if not db == None and not reinit:
- return db
+ if domain in db and not reinit:
+ return db[domain]
if reinit:
import os
@@ -184,9 +184,9 @@ def init_db(domain,reinit=False):
metadata.create_all(engine)
Session = sessionmaker(bind=engine)
- db = Session()
+ db[domain] = Session()
- return db
+ return db[domain]
def last_modify_timestamp(domain):
modifytimestamp_format = conf.get_raw('ldap', 'modifytimestamp_format')