From 4b9a1431dd5a3b8c29ba6a5656a961794b11e683 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Mon, 21 Oct 2013 12:11:35 -0400 Subject: [PATCH 1/2] Ignore collection config arg which other mongo connectors use. --- common/lib/xmodule/xmodule/contentstore/mongo.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common/lib/xmodule/xmodule/contentstore/mongo.py b/common/lib/xmodule/xmodule/contentstore/mongo.py index 98756eccba..11e61e1106 100644 --- a/common/lib/xmodule/xmodule/contentstore/mongo.py +++ b/common/lib/xmodule/xmodule/contentstore/mongo.py @@ -16,8 +16,15 @@ import json class MongoContentStore(ContentStore): - def __init__(self, host, db, port=27017, user=None, password=None, bucket='fs', **kwargs): + # pylint: disable=W0613 + def __init__(self, host, db, port=27017, user=None, password=None, bucket='fs', collection=None, **kwargs): + """ + Establish the connection with the mongo backend and connect to the collections + + :param collection: ignores but provided for consistency w/ other doc_store_config patterns + """ logging.debug('Using MongoDB for static content serving at host={0} db={1}'.format(host, db)) + _db = Connection(host=host, port=port, **kwargs)[db] if user is not None and password is not None: From 8dc9fa886189bb3e7c3070977f5521ca4403d3d6 Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Mon, 21 Oct 2013 12:15:51 -0400 Subject: [PATCH 2/2] Test providing a collection in doc_store_config to contentstore. --- cms/envs/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cms/envs/test.py b/cms/envs/test.py index b391bcbe18..c64e0ef1e8 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -91,6 +91,7 @@ CONTENTSTORE = { 'DOC_STORE_CONFIG': { 'host': 'localhost', 'db': 'test_xcontent', + 'collection': 'dont_trip', }, # allow for additional options that can be keyed on a name, e.g. 'trashcan' 'ADDITIONAL_OPTIONS': {