Projects
Kolab:3.4
pykolab
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 69
View file
pykolab.spec
Changed
@@ -32,6 +32,7 @@ Patch1: pykolab-0.6.12-no-switching-gid-in-logger.patch Patch2: pykolab-0.6.12-dont-drop-privileges-too-early.patch +Patch3: pykolab-0.6.12-allow-auth_cache-reinitialization.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch @@ -189,6 +190,7 @@ %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build autoreconf -v @@ -498,6 +500,7 @@ * Sat Feb 15 2014 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 0.6.12-3 - New upstream bug-fix release - Do not drop privileges too early +- Regenerate auth_cache automatically - Fix logger switching gid * Tue Jan 28 2014 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 0.6.11-1
View file
pykolab-0.6.12-allow-auth_cache-reinitialization.patch
Added
@@ -0,0 +1,86 @@ +commit 10785ecebb741406b9403b1d0c32c1343b9acfd0 +Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> +Date: Sun Feb 16 01:46:24 2014 +0100 + + Allow the auth_cache database to be regenerated automatically when + sqlite on the local filesystem gives errors + +diff --git a/pykolab/auth/ldap/auth_cache.py b/pykolab/auth/ldap/auth_cache.py +index 488deac..bcf38dc 100644 +--- a/pykolab/auth/ldap/auth_cache.py ++++ b/pykolab/auth/ldap/auth_cache.py +@@ -88,12 +88,29 @@ mapper(Entry, entry_table) + + def del_entry(key): + db = init_db() +- _entries = db.query(Entry).filter_by(key=key).delete() ++ ++ try: ++ _entries = db.query(Entry).filter_by(key=key).delete() ++ except sqlalchemy.exc.OperationalError, errmsg: ++ db = init_db(reinit=True) ++ except: sqlalchemy.exc.InvalidRequest, errmsg: ++ db = init_db(reinit=True) ++ finally: ++ _entries = db.query(Entry).filter_by(key=key).delete() ++ + db.commit() + + def get_entry(key): + db = init_db() +- _entries = db.query(Entry).filter_by(key=key).all() ++ ++ try: ++ _entries = db.query(Entry).filter_by(key=key).all() ++ except sqlalchemy.exc.OperationalError, errmsg: ++ db = init_db(reinit=True) ++ except: sqlalchemy.exc.InvalidRequest, errmsg: ++ db = init_db(reinit=True) ++ finally: ++ _entries = db.query(Entry).filter_by(key=key).all() + + if len(_entries) == 0: + return None +@@ -107,7 +124,14 @@ def get_entry(key): + + def set_entry(key, value): + db = init_db() +- _entries = db.query(Entry).filter_by(key=key).all() ++ try: ++ _entries = db.query(Entry).filter_by(key=key).all() ++ except sqlalchemy.exc.OperationalError, errmsg: ++ db = init_db(reinit=True) ++ except: sqlalchemy.exc.InvalidRequest, errmsg: ++ db = init_db(reinit=True) ++ finally: ++ _entries = db.query(Entry).filter_by(key=key).all() + + if len(_entries) == 0: + db.add( +@@ -129,19 +153,24 @@ def purge_entries(db): + db.query(Entry).filter(Entry.last_change <= (datetime.datetime.now() - datetime.timedelta(1))).delete() + db.commit() + +-def init_db(): ++def init_db(reinit=False): + """ + Returns a SQLAlchemy Session() instance. + """ + global db + +- if not db == None: ++ if not db == None and not reinit: + return db + + db_uri = conf.get('ldap', 'auth_cache_uri') + if db_uri == None: + db_uri = 'sqlite:///%s/auth_cache.db' % (KOLAB_LIB_PATH) + ++ if reinit: ++ import os ++ os.path.isfile('%s/auth_cache.db' % (KOLAB_LIB_PATH)): ++ os.unlink('%s/auth_cache.db' % (KOLAB_LIB_PATH)) ++ + echo = conf.debuglevel > 8 + engine = create_engine(db_uri, echo=echo) + metadata.create_all(engine)
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +pykolab (0.6.12-0~kolab4) unstable; urgency=low + + * Regenerate auth_cache automatically + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Sun, 16 Feb 2014 01:49:00 +0100 + pykolab (0.6.12-0~kolab3) unstable; urgency=low * New upstream release
View file
debian.series
Changed
@@ -3,3 +3,4 @@ enable-wallace.patch -p1 pykolab-0.6.12-no-switching-gid-in-logger.patch -p1 pykolab-0.6.12-dont-drop-privileges-too-early.patch -p1 +pykolab-0.6.12-allow-auth_cache-reinitialization.patch -p1
View file
pykolab.dsc
Changed
@@ -2,7 +2,7 @@ Source: pykolab Binary: pykolab, kolab-cli, kolab-conf, kolab-saslauthd, kolab-server, kolab-telemetry, kolab-xml, wallace Architecture: all -Version: 0.6.12-0~kolab3 +Version: 0.6.12-0~kolab4 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.kolab.org
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.