You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/11/27 17:10:47 UTC
git commit: Don't configure activitystream if it's disabled
Updated Branches:
refs/heads/master ef071f2cb -> 3b35ab406
Don't configure activitystream if it's disabled
Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/3b35ab40
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/3b35ab40
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/3b35ab40
Branch: refs/heads/master
Commit: 3b35ab4066f364f172ae36ae0a8e3e8f4f118230
Parents: ef071f2
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Nov 27 16:10:33 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Wed Nov 27 16:10:33 2013 +0000
----------------------------------------------------------------------
Allura/allura/command/base.py | 4 +++-
Allura/allura/command/show_models.py | 10 +++++++---
Allura/allura/websetup/schema.py | 4 +++-
3 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3b35ab40/Allura/allura/command/base.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/base.py b/Allura/allura/command/base.py
index 38bb0d5..e7849f3 100644
--- a/Allura/allura/command/base.py
+++ b/Allura/allura/command/base.py
@@ -24,6 +24,7 @@ from multiprocessing import Process
import pylons
from paste.script import command
from paste.deploy import appconfig
+from paste.deploy.converters import asbool
from paste.registry import Registry
import activitystream
@@ -95,7 +96,8 @@ class Command(command.Command):
from allura import model
M=model
ming.configure(**conf)
- activitystream.configure(**conf)
+ if asbool(conf.get('activitystream.recording.enabled', False)):
+ activitystream.configure(**conf)
pylons.tmpl_context.user = M.User.anonymous()
else:
# Probably being called from another script (websetup, perhaps?)
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3b35ab40/Allura/allura/command/show_models.py
----------------------------------------------------------------------
diff --git a/Allura/allura/command/show_models.py b/Allura/allura/command/show_models.py
index 22ca68f..d24120d 100644
--- a/Allura/allura/command/show_models.py
+++ b/Allura/allura/command/show_models.py
@@ -20,6 +20,7 @@ from collections import defaultdict
from contextlib import contextmanager
from itertools import groupby
+from paste.deploy.converters import asbool
from pylons import tmpl_context as c, app_globals as g
from pymongo.errors import DuplicateKeyError, InvalidDocument
@@ -200,7 +201,11 @@ class EnsureIndexCommand(base.Command):
def command(self):
from allura import model as M
- from activitystream.storage.mingstorage import activity_orm_session
+ main_session_classes = [M.main_orm_session, M.repository_orm_session,
+ M.task_orm_session]
+ if asbool(self.config.get('activitystream.recording.enabled', False)):
+ from activitystream.storage.mingstorage import activity_orm_session
+ main_session_classes.append(activity_orm_session)
self.basic_setup()
main_indexes = defaultdict(lambda: defaultdict(list)) # by db, then collection name
project_indexes = defaultdict(list) # by collection name
@@ -213,8 +218,7 @@ class EnsureIndexCommand(base.Command):
base.log.info('... skipping abstract class %s', cls)
continue
base.log.info('... for class %s', cls)
- if session(cls) in (M.main_orm_session, M.repository_orm_session,
- M.task_orm_session, activity_orm_session):
+ if session(cls) in main_session_classes:
idx = main_indexes[session(cls)][cname]
else:
idx = project_indexes[cname]
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/3b35ab40/Allura/allura/websetup/schema.py
----------------------------------------------------------------------
diff --git a/Allura/allura/websetup/schema.py b/Allura/allura/websetup/schema.py
index 0198f8a..cdfdf42 100644
--- a/Allura/allura/websetup/schema.py
+++ b/Allura/allura/websetup/schema.py
@@ -24,6 +24,7 @@ import logging
import activitystream
from tg import config
import pylons
+from paste.deploy.converters import asbool
from paste.registry import Registry
log = logging.getLogger(__name__)
@@ -39,7 +40,8 @@ def setup_schema(command, conf, vars):
REGISTRY.register(pylons.app_globals, config['pylons.app_globals'])
REGISTRY.register(allura.credentials, allura.lib.security.Credentials())
ming.configure(**conf)
- activitystream.configure(**conf)
+ if asbool(conf.get('activitystream.recording.enabled', False)):
+ activitystream.configure(**conf)
# Nothing to do
log.info('setup_schema called')