From 3b6b066c7224b82fa3f03d8a25b3fd60591e29a6 Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Thu, 20 Aug 2020 16:27:55 -0400 Subject: [PATCH] Cleanup unused CONFIG_ROOT variable and dead code. From what I've gleaned, CONFIG_FILE (and LMS_CFG and STUDIO_CFG environment variables) supercedes CONFIG_ROOT. There's no code anymore that reads the value of the CONFIG_ROOT django setting, and in turn the CONFIG_ROOT environment variable. Tangentially related to DENG-369 --- Dockerfile | 1 - cms/envs/bok_choy.py | 6 +++--- cms/envs/production.py | 5 ----- lms/envs/bok_choy.py | 5 ++--- lms/envs/production.py | 5 ----- 5 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index d42c1ca4d7..850e70ae89 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,7 +56,6 @@ COPY . /edx/app/edx-platform/edx-platform ENV PATH /edx/app/edx-platform/nodeenv/bin:${PATH} ENV PATH ./node_modules/.bin:${PATH} -ENV CONFIG_ROOT /edx/etc/ ENV PATH /edx/app/edx-platform/edx-platform/bin:${PATH} ENV SETTINGS production diff --git a/cms/envs/bok_choy.py b/cms/envs/bok_choy.py index df332b4513..ec34660d91 100644 --- a/cms/envs/bok_choy.py +++ b/cms/envs/bok_choy.py @@ -28,11 +28,11 @@ from openedx.core.release import RELEASE_LINE # This is a convenience for ensuring (a) that we can consistently find the files # and (b) that the files are the same in Jenkins as in local dev. os.environ['SERVICE_VARIANT'] = 'bok_choy_docker' if 'BOK_CHOY_HOSTNAME' in os.environ else 'bok_choy' -os.environ['CONFIG_ROOT'] = path(__file__).abspath().dirname() +CONFIG_ROOT = path(__file__).abspath().dirname() os.environ['STUDIO_CFG'] = str.format("{config_root}/{service_variant}.yml", - config_root=os.environ['CONFIG_ROOT'], + config_root=CONFIG_ROOT, service_variant=os.environ['SERVICE_VARIANT']) -os.environ['REVISION_CFG'] = "{config_root}/revisions.yml".format(config_root=os.environ['CONFIG_ROOT']) +os.environ['REVISION_CFG'] = "{config_root}/revisions.yml".format(config_root=CONFIG_ROOT) from .production import * # pylint: disable=wildcard-import, unused-wildcard-import, wrong-import-position diff --git a/cms/envs/production.py b/cms/envs/production.py index e0baad585f..1348bbbd60 100644 --- a/cms/envs/production.py +++ b/cms/envs/production.py @@ -97,11 +97,6 @@ EDX_PLATFORM_REVISION = REVISION_CONFIG.get('EDX_PLATFORM_REVISION', EDX_PLATFOR # configuration files are read during startup. SERVICE_VARIANT = os.environ.get('SERVICE_VARIANT', None) -# CONFIG_ROOT specifies the directory where the JSON configuration -# files are expected to be found. If not specified, use the project -# directory. -CONFIG_ROOT = path(os.environ.get('CONFIG_ROOT', ENV_ROOT)) - # CONFIG_PREFIX specifies the prefix of the JSON configuration files, # based on the service variant. If no variant is use, don't use a # prefix. diff --git a/lms/envs/bok_choy.py b/lms/envs/bok_choy.py index 513dbf4928..73ad1df276 100644 --- a/lms/envs/bok_choy.py +++ b/lms/envs/bok_choy.py @@ -32,10 +32,9 @@ TEST_ROOT = CONFIG_ROOT.dirname().dirname() / "test_root" # This is a convenience for ensuring (a) that we can consistently find the files # and (b) that the files are the same in Jenkins as in local dev. os.environ['SERVICE_VARIANT'] = 'bok_choy_docker' if 'BOK_CHOY_HOSTNAME' in os.environ else 'bok_choy' -os.environ['CONFIG_ROOT'] = CONFIG_ROOT os.environ['LMS_CFG'] = str.format("{config_root}/{service_variant}.yml", - config_root=os.environ['CONFIG_ROOT'], service_variant=os.environ['SERVICE_VARIANT']) -os.environ['REVISION_CFG'] = "{config_root}/revisions.yml".format(config_root=os.environ['CONFIG_ROOT']) + config_root=CONFIG_ROOT, service_variant=os.environ['SERVICE_VARIANT']) +os.environ['REVISION_CFG'] = "{config_root}/revisions.yml".format(config_root=CONFIG_ROOT) from .production import * # pylint: disable=wildcard-import, unused-wildcard-import, wrong-import-position diff --git a/lms/envs/production.py b/lms/envs/production.py index 5479e412bf..3f3c792602 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -109,11 +109,6 @@ EDX_PLATFORM_REVISION = REVISION_CONFIG.get('EDX_PLATFORM_REVISION', EDX_PLATFOR # configuration files are read during startup. SERVICE_VARIANT = os.environ.get('SERVICE_VARIANT', None) -# CONFIG_ROOT specifies the directory where the JSON configuration -# files are expected to be found. If not specified, use the project -# directory. -CONFIG_ROOT = path(os.environ.get('CONFIG_ROOT', ENV_ROOT)) - # CONFIG_PREFIX specifies the prefix of the JSON configuration files, # based on the service variant. If no variant is use, don't use a # prefix.