Bug 1212822 - Only load local.py in the Vagrant environment

Ideally we'd remove local.py entirely, in favour of environment
variables. However at least for now, it's still needed for setting the
logging preferences/enabling debugging apps for the Vagrant environment.
As such, it's being kept but disabled everywhere other than for local
development.

The stage/prod local.py files have been vetted, and (a) the contents
confirmed to match that in the environment, and (b) all affected
settings in base.py checked to ensure they read the correct environment
variable. Heroku doesn't have a local.py. As such, this should be a
no-op other than locally, where a Vagrant provision will be required.
This commit is contained in:
Ed Morley 2015-10-08 13:42:26 +01:00
Родитель 19d3570a1e
Коммит d9bd20efd1
2 изменённых файлов: 9 добавлений и 7 удалений

Просмотреть файл

@ -30,6 +30,7 @@ line {"etc-hosts":
file {"/etc/profile.d/treeherder.sh": file {"/etc/profile.d/treeherder.sh":
content => " content => "
export ENABLE_LOCAL_SETTINGS_FILE='True'
export DATABASE_URL='mysql://${DB_USER}:${DB_PASS}@localhost/treeherder' export DATABASE_URL='mysql://${DB_USER}:${DB_PASS}@localhost/treeherder'
export DATABASE_URL_RO='mysql://${DB_USER}:${DB_PASS}@localhost/treeherder' export DATABASE_URL_RO='mysql://${DB_USER}:${DB_PASS}@localhost/treeherder'
export TREEHERDER_DEBUG='1' export TREEHERDER_DEBUG='1'

Просмотреть файл

@ -9,7 +9,6 @@ from kombu import (Exchange,
from treeherder import path from treeherder import path
# These settings can all be optionally set via env vars, or in local.py:
env = environ.Env() env = environ.Env()
TREEHERDER_MEMCACHED = os.environ.get("TREEHERDER_MEMCACHED", "127.0.0.1:11211") TREEHERDER_MEMCACHED = os.environ.get("TREEHERDER_MEMCACHED", "127.0.0.1:11211")
@ -386,12 +385,14 @@ PULSE_DATA_INGESTION_QUEUES_DURABLE = env("PULSE_DATA_INGESTION_QUEUES_DURABLE",
PULSE_DATA_INGESTION_QUEUES_AUTO_DELETE = env("PULSE_DATA_INGESTION_QUEUES_AUTO_DELETE", PULSE_DATA_INGESTION_QUEUES_AUTO_DELETE = env("PULSE_DATA_INGESTION_QUEUES_AUTO_DELETE",
default=False) default=False)
# Note: All the configs below this import will take precedence over what is # The git-ignored local.py settings file should only be used for local development.
# defined in local.py! if env.bool("ENABLE_LOCAL_SETTINGS_FILE", default=False):
try: # Note: All the configs below this import will take precedence over what is
from .local import * # defined in local.py!
except ImportError: try:
pass from .local import *
except ImportError:
pass
INSTALLED_APPS += LOCAL_APPS INSTALLED_APPS += LOCAL_APPS