diff --git a/cms/envs/aws.py b/cms/envs/aws.py index 6b04d1fbf6..63605461c2 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -15,6 +15,7 @@ import os from path import path from dealer.git import git +from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed # SERVICE_VARIANT specifies name of the variant used, which decides what JSON # configuration files are read during startup. @@ -229,7 +230,7 @@ if AWS_SECRET_ACCESS_KEY == "": AWS_SECRET_ACCESS_KEY = None DATABASES = AUTH_TOKENS['DATABASES'] -MODULESTORE = AUTH_TOKENS.get('MODULESTORE', MODULESTORE) +MODULESTORE = convert_module_store_setting_if_needed(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/devstack.py b/cms/envs/devstack.py index 6dc95c1925..145c1d8480 100644 --- a/cms/envs/devstack.py +++ b/cms/envs/devstack.py @@ -72,8 +72,12 @@ DEBUG_TOOLBAR_CONFIG = { DEBUG_TOOLBAR_MONGO_STACKTRACES = False ############################################################################### -# Lastly, see if the developer has any local overrides. +# See if the developer has any local overrides. try: from .private import * # pylint: disable=F0401 except ImportError: pass + +##################################################################### +# Lastly, run any migrations, if needed. +MODULESTORE = convert_module_store_setting_if_needed(MODULESTORE) diff --git a/common/lib/xmodule/xmodule/modulestore/django.py b/common/lib/xmodule/xmodule/modulestore/django.py index 5107181e6d..973833f4f8 100644 --- a/common/lib/xmodule/xmodule/modulestore/django.py +++ b/common/lib/xmodule/xmodule/modulestore/django.py @@ -18,7 +18,6 @@ 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: @@ -86,7 +85,6 @@ 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/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py b/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py index eb96394c27..a0b63d4691 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/test_modulestore_settings.py @@ -2,7 +2,7 @@ Tests for testing the modulestore settings migration code. """ import copy -from django.test import TestCase +from unittest import TestCase from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 1306c4dcdf..a197cbd480 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -18,6 +18,7 @@ from logsettings import get_logger_config import os from path import path +from xmodule.modulestore.modulestore_settings import convert_module_store_setting_if_needed # SERVICE_VARIANT specifies name of the variant used, which decides what JSON # configuration files are read during startup. @@ -324,7 +325,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 = AUTH_TOKENS.get('MODULESTORE', MODULESTORE) +MODULESTORE = convert_module_store_setting_if_needed(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/devstack.py b/lms/envs/devstack.py index a89de22001..330725df2e 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -82,8 +82,12 @@ FEATURES['ENABLE_PAYMENT_FAKE'] = True CC_PROCESSOR['CyberSource']['PURCHASE_ENDPOINT'] = '/shoppingcart/payment_fake/' ##################################################################### -# Lastly, see if the developer has any local overrides. +# See if the developer has any local overrides. try: from .private import * # pylint: disable=F0401 except ImportError: pass + +##################################################################### +# Lastly, run any migrations, if needed. +MODULESTORE = convert_module_store_setting_if_needed(MODULESTORE)