Skip to content

Commit

Permalink
Settings: fix reference to environment variable
Browse files Browse the repository at this point in the history
The runner already expects the `ZING_SETTINGS` variable.
  • Loading branch information
julen committed Aug 15, 2017
1 parent ec8c51d commit c4f56f9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/server/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Settings
========

You will find all the Pootle-specific settings in this document.
You will find all the Zing-specific settings in this document.

If you have upgraded, you might want to compare your previous copy to the one
distributed with the Pootle version for any new settings you might be interested
Expand All @@ -21,12 +21,12 @@ These settings will override the defaults set by Pootle.

An alternative location for the settings file can be specified by setting the
``-c </path/to/settings.conf/>`` flag when executing the runner. You can also
set the :envvar:`POOTLE_SETTINGS` environment variable to specify the path to
set the :envvar:`ZING_SETTINGS` environment variable to specify the path to
the custom configuration file. The environment variable will take precedence
over the command-line flag.

If instead of an installation you deployed Pootle straight from the git
repository, you can either set the :envvar:`POOTLE_SETTINGS` environment
repository, you can either set the :envvar:`ZING_SETTINGS` environment
variable or put a file under the :file:`pootle/settings/` directory. Note that
the files in this directory are read in alphabetical order, and **creating a
90-local.conf file is recommended** (files ending in *-local.conf* will be
Expand Down
12 changes: 6 additions & 6 deletions pootle/settings/95-outro.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import logging


# Load custom settings if any have been defined
pootle_settings_envvar = 'POOTLE_SETTINGS'
pootle_settings_filepath = os.environ.get(pootle_settings_envvar, None)
zing_settings_envvar = 'ZING_SETTINGS'
zing_settings_filepath = os.environ.get(zing_settings_envvar, None)

if pootle_settings_filepath is not None:
if zing_settings_filepath is not None:
logger = logging.getLogger('pootle.settings')

# Set a handler to avoid the "No handlers could be found" error to happen.
Expand All @@ -23,12 +23,12 @@ if pootle_settings_filepath is not None:

try:
logger.debug(u'Loading custom settings from %r...',
pootle_settings_filepath)
execfile(os.path.abspath(pootle_settings_filepath))
zing_settings_filepath)
execfile(os.path.abspath(zing_settings_filepath))
except (IOError, OSError), e:
logger.error(u"Cannot access configuration file at %r as defined by "
u"the %r environment variable:\n%s",
pootle_settings_filepath, pootle_settings_envvar, e)
zing_settings_filepath, zing_settings_envvar, e)
import sys
sys.exit(1)

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def pytest_configure():
from pootle import syspath_override # Needed for monkey-patching
syspath_override
os.environ['DJANGO_SETTINGS_MODULE'] = 'pootle.settings'
os.environ['POOTLE_SETTINGS'] = os.path.join(WORKING_DIR, 'settings.py')
os.environ['ZING_SETTINGS'] = os.path.join(WORKING_DIR, 'settings.py')
# The call to `setup()` was needed before a fix for
# pytest-dev/pytest-django#146 was available. This happened in version
# 2.9; unfortunately upgrading to 2.9+ is not possible yet because a fix
Expand Down

0 comments on commit c4f56f9

Please sign in to comment.