diff options
Diffstat (limited to 'conductor')
-rw-r--r-- | conductor/conductor/common/sms.py | 21 | ||||
-rw-r--r-- | conductor/conductor/service.py | 5 |
2 files changed, 15 insertions, 11 deletions
diff --git a/conductor/conductor/common/sms.py b/conductor/conductor/common/sms.py index ace2e68..c5eee3a 100644 --- a/conductor/conductor/common/sms.py +++ b/conductor/conductor/common/sms.py @@ -35,6 +35,9 @@ LOG = log.getLogger(__name__) CONF = cfg.CONF AAF_SMS_OPTS = [ + cfg.BoolOpt('is_enabled', + default=True, + help='Is Secret Management service enabled'), cfg.StrOpt('aaf_sms_url', default='https://aaf-sms.onap:10443', help='Base URL for SMS, up to and not including ' @@ -99,15 +102,15 @@ def retrieve_secrets(): def load_secrets(): config = CONF secret_dict = retrieve_secrets() - config.aai.username = secret_dict['aai']['username'] - config.aai.password = secret_dict['aai']['password'] - config.conductor_api.username = secret_dict['conductor_api']['username'] - config.conductor_api.password = secret_dict['conductor_api']['password'] - config.music_api.aafuser = secret_dict['music_api']['aafuser'] - config.music_api.aafpass = secret_dict['music_api']['aafpass'] - config.music_api.aafns = secret_dict['music_api']['aafns'] - config.sdnc.username = secret_dict['sdnc']['username'] - config.sdnc.password = secret_dict['sdnc']['password'] + config.set_override('username', secret_dict['aai']['username'], 'aai') + config.set_override('password', secret_dict['aai']['password'], 'aai') + config.set_override('username', secret_dict['conductor_api']['username'], 'conductor_api') + config.set_override('password', secret_dict['conductor_api']['password'], 'conductor_api') + config.set_override('aafuser', secret_dict['music_api']['aafuser'], 'music_api') + config.set_override('aafpass', secret_dict['music_api']['aafpass'], 'music_api') + config.set_override('aafns', secret_dict['music_api']['aafns'], 'music_api') + config.set_override('username', secret_dict['sdnc']['username'], 'sdnc') + config.set_override('password', secret_dict['sdnc']['password'], 'sdnc') def delete_secrets(): diff --git a/conductor/conductor/service.py b/conductor/conductor/service.py index 982123c..42fe99f 100644 --- a/conductor/conductor/service.py +++ b/conductor/conductor/service.py @@ -108,6 +108,7 @@ def prepare_service(argv=None, config_files=None): if argv: gmr.TextGuruMeditation.setup_autorun(version) messaging.setup() - # TODO(Dileep): Uncomment once Helm charts to preload secrets available - # sms.load_secrets() + # Load secrets from SMS + if conf.aaf_sms.is_enabled: + sms.load_secrets() return conf |