Allow for specifying a KOLLA_CONFIG_FILE

Incases where it is useful to place many config.json files
under the same directory (ie one for config_glance_api.json or
one for config_glance_registry.json) we should be able to
specify which file under that directory do we actually want to
use (instead of assuming it is always config.json).

Change-Id: I42eeb093d29bac27d71ee08e55e115c2d8b5e9ae
This commit is contained in:
Joshua Harlow 2016-11-15 17:09:13 -08:00
parent 0963c2255a
commit e284d4fbea

View File

@ -155,7 +155,9 @@ def load_config():
sys.exit(1)
def load_from_file():
config_file = '/var/lib/kolla/config_files/config.json'
config_file = os.environ.get("KOLLA_CONFIG_FILE")
if not config_file:
config_file = '/var/lib/kolla/config_files/config.json'
LOG.info("Loading config file at %s", config_file)
# Attempt to read config file