diff --git a/cms/envs/aws.py b/cms/envs/aws.py index 0d4d20b0ce..6b04d1fbf6 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -229,7 +229,7 @@ if AWS_SECRET_ACCESS_KEY == "": AWS_SECRET_ACCESS_KEY = None DATABASES = AUTH_TOKENS['DATABASES'] -MODULESTORE = convert_module_store_setting_if_needed(AUTH_TOKENS['MODULESTORE']) +MODULESTORE = AUTH_TOKENS.get('MODULESTORE', MODULESTORE) CONTENTSTORE = AUTH_TOKENS['CONTENTSTORE'] DOC_STORE_CONFIG = AUTH_TOKENS['DOC_STORE_CONFIG'] # Datadog for events! diff --git a/cms/envs/common.py b/cms/envs/common.py index a5dd3ddad2..a9be299409 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -30,11 +30,11 @@ import sys import lms.envs.common # Although this module itself may not use these imported variables, other dependent modules may. from lms.envs.common import ( - USE_TZ, TECH_SUPPORT_EMAIL, PLATFORM_NAME, BUGS_EMAIL, DOC_STORE_CONFIG, ALL_LANGUAGES, WIKI_ENABLED, MODULESTORE + USE_TZ, TECH_SUPPORT_EMAIL, PLATFORM_NAME, BUGS_EMAIL, DOC_STORE_CONFIG, ALL_LANGUAGES, WIKI_ENABLED, MODULESTORE, + update_module_store_settings ) from path import path from warnings import simplefilter -from lms.envs.modulestore_settings import * from lms.lib.xblock.mixin import LmsBlockMixin from dealer.git import git diff --git a/common/lib/xmodule/xmodule/modulestore/django.py b/common/lib/xmodule/xmodule/modulestore/django.py index 973833f4f8..5107181e6d 100644 --- a/common/lib/xmodule/xmodule/modulestore/django.py +++ b/common/lib/xmodule/xmodule/modulestore/django.py @@ -18,6 +18,7 @@ from xmodule.modulestore.loc_mapper_store import LocMapperStore from xmodule.util.django import get_current_request_hostname import xmodule.modulestore # pylint: disable=unused-import from xmodule.contentstore.django import contentstore +from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed # We may not always have the request_cache module available try: @@ -85,6 +86,7 @@ def modulestore(): """ global _MIXED_MODULESTORE # pylint: disable=global-statement if _MIXED_MODULESTORE is None: + settings.MODULESTORE = convert_module_store_setting_if_needed(settings.MODULESTORE) _MIXED_MODULESTORE = create_modulestore_instance( settings.MODULESTORE['default']['ENGINE'], contentstore(), diff --git a/lms/envs/modulestore_settings.py b/common/lib/xmodule/xmodule/modulestore/modulestore_settings.py similarity index 100% rename from lms/envs/modulestore_settings.py rename to common/lib/xmodule/xmodule/modulestore/modulestore_settings.py diff --git a/lms/envs/test_modulestore_settings.py b/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py similarity index 98% rename from lms/envs/test_modulestore_settings.py rename to common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py index 3f1e1ba8e7..eb96394c27 100644 --- a/lms/envs/test_modulestore_settings.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py @@ -3,7 +3,7 @@ Tests for testing the modulestore settings migration code. """ import copy from django.test import TestCase -from lms.envs.modulestore_settings import convert_module_store_setting_if_needed +from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed class ModuleStoreSettingsMigration(TestCase): diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 70d1f19ee5..1306c4dcdf 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -324,7 +324,7 @@ XQUEUE_INTERFACE = AUTH_TOKENS['XQUEUE_INTERFACE'] # Get the MODULESTORE from auth.json, but if it doesn't exist, # use the one from common.py -MODULESTORE = convert_module_store_setting_if_needed(AUTH_TOKENS.get('MODULESTORE', MODULESTORE)) +MODULESTORE = AUTH_TOKENS.get('MODULESTORE', MODULESTORE) CONTENTSTORE = AUTH_TOKENS.get('CONTENTSTORE', CONTENTSTORE) DOC_STORE_CONFIG = AUTH_TOKENS.get('DOC_STORE_CONFIG', DOC_STORE_CONFIG) MONGODB_LOG = AUTH_TOKENS.get('MONGODB_LOG', {}) diff --git a/lms/envs/common.py b/lms/envs/common.py index eb54f7e58d..d1d764341d 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -33,7 +33,7 @@ from path import path from warnings import simplefilter from .discussionsettings import * -from .modulestore_settings import * +from xmodule.modulestore.modulestore_settings import update_module_store_settings from lms.lib.xblock.mixin import LmsBlockMixin