diff options
author | hariharan97 <rh20085046@wipro.com> | 2020-12-03 13:33:11 +0530 |
---|---|---|
committer | hariharan97 <rh20085046@wipro.com> | 2020-12-14 17:38:27 +0530 |
commit | d2401bc3d6b3366951faacfd9984d37ee73d126b (patch) | |
tree | 463ee4f06af14073f4327f96ac38448b2f53d80f /osdf/config/base.py | |
parent | efb0ba440317993d68b6f94c370754272f02addf (diff) |
OOF - Externalize configuration with Consul
Issue-ID: OPTFRA-875
Signed-off-by: hariharan97 <rh20085046@wipro.com>
Change-Id: I30d25e082227d7b39f7d391365197e9130dc51e8
Signed-off-by: hariharan97 <rh20085046@wipro.com>
Diffstat (limited to 'osdf/config/base.py')
-rw-r--r-- | osdf/config/base.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/osdf/config/base.py b/osdf/config/base.py index 2393642..be693cb 100644 --- a/osdf/config/base.py +++ b/osdf/config/base.py @@ -18,10 +18,11 @@ # import os - +from osdf.config.consulconfig import call_consul_kv import osdf.config.credentials as creds import osdf.config.loader as config_loader from osdf.utils.programming_utils import DotDict +from threading import Thread config_spec = { "deployment": os.environ.get("OSDF_CONFIG_FILE", "config/osdf_config.yaml"), @@ -39,3 +40,10 @@ http_basic_auth_credentials = creds.load_credentials(osdf_config) dmaap_creds = creds.dmaap_creds() creds_prefixes = {"so": "so", "cm": "cmPortal", "pcih": "pciHMS"} + +osdf_config_deployment = osdf_config.deployment + + +if osdf_config.deployment.get('activateConsulConfig'): + consulthread = Thread(target=call_consul_kv, args=(osdf_config,)) + consulthread.start() |