Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
fd729314
Commit
fd729314
authored
Oct 09, 2013
by
Carlos Andrés Rocha
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1263 from rocha/add-config-root-env-variable-to-aws-config
Add variable to set location of config files on aws
parents
46ed857c
f2bf95b2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
22 deletions
+28
-22
cms/envs/aws.py
+15
-11
lms/envs/aws.py
+13
-11
No files found.
cms/envs/aws.py
View file @
fd729314
...
...
@@ -12,20 +12,24 @@ from .common import *
from
logsettings
import
get_logger_config
import
os
# specified as an environment variable. Typically this is set
# in the service's upstart script and corresponds exactly to the service name.
# Service variants apply config differences via env and auth JSON files,
# the names of which correspond to the variant.
# SERVICE_VARIANT specifies name of the variant used, which decides what JSON
# configuration files are read during startup.
SERVICE_VARIANT
=
os
.
environ
.
get
(
'SERVICE_VARIANT'
,
None
)
# when not variant is specified we attempt to load an unvaried
# config set.
CONFIG_PREFIX
=
""
# CONFIG_ROOT specifies the directory where the JSON configuration
# files are expected to be found. If not specified, use the project
# directory.
CONFIG_ROOT
=
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.
CONFIG_PREFIX
=
SERVICE_VARIANT
+
"."
if
SERVICE_VARIANT
else
""
if
SERVICE_VARIANT
:
CONFIG_PREFIX
=
SERVICE_VARIANT
+
"."
############### ALWAYS THE SAME ################################
DEBUG
=
False
TEMPLATE_DEBUG
=
False
...
...
@@ -77,7 +81,7 @@ CELERY_QUEUES = {
############# NON-SECURE ENV CONFIG ##############################
# Things like server locations, ports, etc.
with
open
(
ENV
_ROOT
/
CONFIG_PREFIX
+
"env.json"
)
as
env_file
:
with
open
(
CONFIG
_ROOT
/
CONFIG_PREFIX
+
"env.json"
)
as
env_file
:
ENV_TOKENS
=
json
.
load
(
env_file
)
EMAIL_BACKEND
=
ENV_TOKENS
.
get
(
'EMAIL_BACKEND'
,
EMAIL_BACKEND
)
...
...
@@ -134,7 +138,7 @@ if "TRACKING_IGNORE_URL_PATTERNS" in ENV_TOKENS:
################ SECURE AUTH ITEMS ###############################
# Secret things: passwords, access keys, etc.
with
open
(
ENV
_ROOT
/
CONFIG_PREFIX
+
"auth.json"
)
as
auth_file
:
with
open
(
CONFIG
_ROOT
/
CONFIG_PREFIX
+
"auth.json"
)
as
auth_file
:
AUTH_TOKENS
=
json
.
load
(
auth_file
)
# If Segment.io key specified, load it and turn on Segment.io if the feature flag is set
...
...
lms/envs/aws.py
View file @
fd729314
...
...
@@ -17,18 +17,20 @@ from .common import *
from
logsettings
import
get_logger_config
import
os
# specified as an environment variable. Typically this is set
# in the service's upstart script and corresponds exactly to the service name.
# Service variants apply config differences via env and auth JSON files,
# the names of which correspond to the variant.
# SERVICE_VARIANT specifies name of the variant used, which decides what JSON
# configuration files are read during startup.
SERVICE_VARIANT
=
os
.
environ
.
get
(
'SERVICE_VARIANT'
,
None
)
# when not variant is specified we attempt to load an unvaried
# config set.
CONFIG_PREFIX
=
""
# CONFIG_ROOT specifies the directory where the JSON configuration
# files are expected to be found. If not specified, use the project
# directory.
CONFIG_ROOT
=
os
.
environ
.
get
(
'CONFIG_ROOT'
,
ENV_ROOT
)
if
SERVICE_VARIANT
:
CONFIG_PREFIX
=
SERVICE_VARIANT
+
"."
# 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.
CONFIG_PREFIX
=
SERVICE_VARIANT
+
"."
if
SERVICE_VARIANT
else
""
################################ ALWAYS THE SAME ##############################
...
...
@@ -96,7 +98,7 @@ CELERY_QUEUES = {
########################## NON-SECURE ENV CONFIG ##############################
# Things like server locations, ports, etc.
with
open
(
ENV
_ROOT
/
CONFIG_PREFIX
+
"env.json"
)
as
env_file
:
with
open
(
CONFIG
_ROOT
/
CONFIG_PREFIX
+
"env.json"
)
as
env_file
:
ENV_TOKENS
=
json
.
load
(
env_file
)
PLATFORM_NAME
=
ENV_TOKENS
.
get
(
'PLATFORM_NAME'
,
PLATFORM_NAME
)
...
...
@@ -198,7 +200,7 @@ if "TRACKING_IGNORE_URL_PATTERNS" in ENV_TOKENS:
############################## SECURE AUTH ITEMS ###############
# Secret things: passwords, access keys, etc.
with
open
(
ENV
_ROOT
/
CONFIG_PREFIX
+
"auth.json"
)
as
auth_file
:
with
open
(
CONFIG
_ROOT
/
CONFIG_PREFIX
+
"auth.json"
)
as
auth_file
:
AUTH_TOKENS
=
json
.
load
(
auth_file
)
############### Mixed Related(Secure/Not-Secure) Items ##########
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment