From 8d951ae8aeacff2fdc25867dcc72d5b9ffe4bb39 Mon Sep 17 00:00:00 2001 From: Danial Malik Date: Mon, 30 Mar 2020 18:38:25 +0500 Subject: [PATCH] Import private.py in devstack_docker.py files instead of devstack.py (#23512) Background: I use private.py a lot in my devstack for my private configurations. But issues are raised when I need to change/override a setting that is defined in devstack_docker.py file. Since that file's contents are loaded after private.py, my private.py is useless against the settings in devstack_docker.py. Description: Now that the devstack is dockerized, I think it makes more sense to import the private.py in the devstack_docker.py files i.e. at the end of configuration files hierarchy. --- cms/envs/devstack.py | 5 ----- cms/envs/devstack_docker.py | 5 +++++ lms/envs/devstack.py | 5 ----- lms/envs/devstack_docker.py | 5 +++++ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cms/envs/devstack.py b/cms/envs/devstack.py index 460b357ebd..332b1a9b29 100644 --- a/cms/envs/devstack.py +++ b/cms/envs/devstack.py @@ -183,11 +183,6 @@ plugin_settings.add_plugins(__name__, plugin_constants.ProjectType.CMS, plugin_c OPENAPI_CACHE_TIMEOUT = 0 -############################################################################### -# See if the developer has any local overrides. -if os.path.isfile(join(dirname(abspath(__file__)), 'private.py')): - from .private import * # pylint: disable=import-error,wildcard-import - ##################################################################### # Lastly, run any migrations, if needed. MODULESTORE = convert_module_store_setting_if_needed(MODULESTORE) diff --git a/cms/envs/devstack_docker.py b/cms/envs/devstack_docker.py index 20a4f3346a..e583f4802c 100644 --- a/cms/envs/devstack_docker.py +++ b/cms/envs/devstack_docker.py @@ -26,3 +26,8 @@ JWT_AUTH.update({ 'JWT_SECRET_KEY': 'lms-secret', 'JWT_AUDIENCE': 'lms-key', }) + +############################################################################### +# See if the developer has any local overrides. +if os.path.isfile(join(dirname(abspath(__file__)), 'private.py')): + from .private import * # pylint: disable=import-error,wildcard-import diff --git a/lms/envs/devstack.py b/lms/envs/devstack.py index 9e01cc1357..865aca330a 100644 --- a/lms/envs/devstack.py +++ b/lms/envs/devstack.py @@ -282,11 +282,6 @@ REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES'] += ( OPENAPI_CACHE_TIMEOUT = 0 -##################################################################### -# See if the developer has any local overrides. -if os.path.isfile(join(dirname(abspath(__file__)), 'private.py')): - from .private import * # pylint: disable=import-error,wildcard-import - ##################################################################### # Lastly, run any migrations, if needed. MODULESTORE = convert_module_store_setting_if_needed(MODULESTORE) diff --git a/lms/envs/devstack_docker.py b/lms/envs/devstack_docker.py index 71182550fa..9c069d8b34 100644 --- a/lms/envs/devstack_docker.py +++ b/lms/envs/devstack_docker.py @@ -85,6 +85,11 @@ SYSTEM_WIDE_ROLE_CLASSES.extend(['system_wide_roles.SystemWideRoleAssignment']) if FEATURES['ENABLE_ENTERPRISE_INTEGRATION']: SYSTEM_WIDE_ROLE_CLASSES.extend(['enterprise.SystemWideEnterpriseUserRoleAssignment']) +##################################################################### +# See if the developer has any local overrides. +if os.path.isfile(join(dirname(abspath(__file__)), 'private.py')): + from .private import * # pylint: disable=import-error,wildcard-import + ########################## THEMING ####################### # If you want to enable theming in devstack, uncomment this section and add any relevant # theme directories to COMPREHENSIVE_THEME_DIRS