[TurboGears] Patch to conditionalize creating visit tables which enables a workaround for
Toshio くらとみ
toshio at fedoraproject.org
Wed Jun 26 06:24:05 UTC 2013
commit 24ea069fe629f4034b3767e2347c7563257719ec
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date: Tue Jun 25 23:23:49 2013 -0700
Patch to conditionalize creating visit tables which enables a workaround for
database errors preventing VisitIdentity from initializing at application startup:
https://bugzilla.redhat.com/show_bug.cgi?id=977690
TurboGears-conditionalize-visit-db-creation.patch | 32 +++++++++++++++++++++
TurboGears.spec | 12 +++++++-
2 files changed, 43 insertions(+), 1 deletions(-)
---
diff --git a/TurboGears-conditionalize-visit-db-creation.patch b/TurboGears-conditionalize-visit-db-creation.patch
new file mode 100644
index 0000000..665f210
--- /dev/null
+++ b/TurboGears-conditionalize-visit-db-creation.patch
@@ -0,0 +1,32 @@
+Index: TurboGears-1.1.3/turbogears/identity/visitor.py
+===================================================================
+--- TurboGears-1.1.3.orig/turbogears/identity/visitor.py
++++ TurboGears-1.1.3/turbogears/identity/visitor.py
+@@ -41,8 +41,9 @@ def start_extension():
+ "Visit tracking must be enabled (visit.on)")
+
+ log.info("Identity starting")
+- # Temporary until tg-admin can call create_extension_model
+- create_extension_model()
++ if config.get('identity.create_model', True):
++ # Temporary until tg-admin can call create_extension_model
++ create_extension_model()
+ # Register the plugin for the Visit Tracking framework
+ visit.enable_visit_plugin(IdentityVisitPlugin())
+
+Index: TurboGears-1.1.3/turbogears/visit/api.py
+===================================================================
+--- TurboGears-1.1.3.orig/turbogears/visit/api.py
++++ TurboGears-1.1.3/turbogears/visit/api.py
+@@ -272,8 +272,9 @@ class BaseVisitManager(threading.Thread)
+ self.lock = threading.Lock()
+ self._shutdown = threading.Event()
+ self.interval = config.get('visit.interval', 30) # seconds
+- # We must create the visit model before the manager thread is started.
+- self.create_model()
++ if config.get('visit.create_model', True):
++ # We must create the visit model before the manager thread is started.
++ self.create_model()
+ self.setDaemon(True)
+ self.start()
+
diff --git a/TurboGears.spec b/TurboGears.spec
index 05e2389..fb641c4 100644
--- a/TurboGears.spec
+++ b/TurboGears.spec
@@ -4,7 +4,7 @@
Name: TurboGears
Version: 1.1.3
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Back-to-front web development in Python
Group: Development/Languages
@@ -19,6 +19,10 @@ Patch2: turbogears-feed.patch
# Backport upstream commit r7389
Patch3: turbogears-httponly.patch
Patch4: turbgears-identity-exception.patch
+# Conditionalize creation of visit tables on the identity.create_model() config value.
+# This helps prevent db errors when starting the application:
+# https://bugzilla.redhat.com/show_bug.cgi?id=977690
+Patch5: TurboGears-conditionalize-visit-db-creation.patch
# Patch to allow turbogears to work with old turbokid until/unless RHEL6
# updates
Patch100: TurboGears-old-turbokid.patch
@@ -117,6 +121,7 @@ TurboGears is easy to use for a wide range of web applications.
%patch2 -p1 -b .feed
%patch3 -p3 -b .httponly
%patch4 -p1 -b .identexc
+%patch5 -p1 -b .identcreate
%if 0%{?rhel} && 0%{?rhel} >= 6
%patch100 -p1 -b .deps
%endif
@@ -159,6 +164,11 @@ rm -rf %{buildroot}
%{python_sitelib}/turbogears/
%changelog
+* Tue Jun 25 2013 Toshio Kuratomi <toshio at fedoraproject.org> - 1.1.3-7
+- Patch to conditionalize creating visit tables which enables a workaround for
+ database errors preventing VisitIdentity from initializing at application startup:
+ https://bugzilla.redhat.com/show_bug.cgi?id=977690
+
* Thu Apr 11 2013 Toshio Kuratomi <toshio at fedoraproject.org> - 1.1.3-6
- Patch to fix naming a caught exception
More information about the scm-commits
mailing list