Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
1b63f401
Unverified
Commit
1b63f401
authored
4 years ago
by
Feanil Patel
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #23052 from edx/feanil/production_py_autoload
Auto load any keys/values from the yaml config file.
parents
39dcc8b1
bf320f03
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cms/envs/production.py
+20
-0
20 additions, 0 deletions
cms/envs/production.py
lms/envs/production.py
+21
-0
21 additions, 0 deletions
lms/envs/production.py
with
41 additions
and
0 deletions
cms/envs/production.py
+
20
−
0
View file @
1b63f401
...
...
@@ -8,6 +8,7 @@ This is the default template for our main set of AWS servers.
import
codecs
import
copy
import
os
import
yaml
...
...
@@ -43,6 +44,25 @@ with codecs.open(CONFIG_FILE, encoding='utf-8') as f:
ENV_TOKENS
=
__config__
AUTH_TOKENS
=
__config__
# Add the key/values from config into the global namespace of this module.
# But don't override the FEATURES dict because we do that in an additive way.
__config_copy__
=
copy
.
deepcopy
(
__config__
)
KEYS_WITH_MERGED_VALUES
=
[
'
FEATURES
'
,
'
TRACKING_BACKENDS
'
,
'
EVENT_TRACKING_BACKENDS
'
,
'
JWT_AUTH
'
,
'
CELERY_QUEUES
'
,
'
MKTG_URL_LINK_MAP
'
,
'
MKTG_URL_OVERRIDES
'
,
]
for
key
in
KEYS_WITH_MERGED_VALUES
:
if
key
in
__config_copy__
:
del
__config_copy__
[
key
]
vars
().
update
(
__config_copy__
)
# A file path to a YAML file from which to load all the code revisions currently deployed
REVISION_CONFIG_FILE
=
get_env_setting
(
'
REVISION_CFG
'
)
...
...
This diff is collapsed.
Click to expand it.
lms/envs/production.py
+
21
−
0
View file @
1b63f401
...
...
@@ -19,6 +19,7 @@ Common traits:
import
codecs
import
copy
import
datetime
import
os
...
...
@@ -55,6 +56,26 @@ with codecs.open(CONFIG_FILE, encoding='utf-8') as f:
ENV_TOKENS
=
__config__
AUTH_TOKENS
=
__config__
# Add the key/values from config into the global namespace of this module.
# But don't override the FEATURES dict because we do that in an additive way.
__config_copy__
=
copy
.
deepcopy
(
__config__
)
KEYS_WITH_MERGED_VALUES
=
[
'
FEATURES
'
,
'
TRACKING_BACKENDS
'
,
'
EVENT_TRACKING_BACKENDS
'
,
'
JWT_AUTH
'
,
'
CELERY_QUEUES
'
,
'
MKTG_URL_LINK_MAP
'
,
'
MKTG_URL_OVERRIDES
'
,
]
for
key
in
KEYS_WITH_MERGED_VALUES
:
if
key
in
__config_copy__
:
del
__config_copy__
[
key
]
vars
().
update
(
__config_copy__
)
# A file path to a YAML file from which to load all the code revisions currently deployed
REVISION_CONFIG_FILE
=
get_env_setting
(
'
REVISION_CFG
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment