Extend config-grabbing magic to new oslo.config

Some changes (in what are admittedly private methods) from oslo.config
5.x to 6.x broke our hacky bits. These bits have now been adjusted to
be compatible with a wider range of oslo.config versions.

This delicate code must be maintained in order to support grabbing
config values from [keystone_authtoken], a behavior which is usually
discouraged.

Change-Id: I9aaa4a3e9052a61269bb7ffcc642383ad6c5a0d8
Story: 2001835
Task: 12598
This commit is contained in:
Jeremy Freudberg 2018-04-14 16:37:56 +00:00
parent 106647295f
commit ee42f01b41
1 changed files with 2 additions and 0 deletions

View File

@ -40,6 +40,8 @@ def _get_keystoneauth_cfg(name):
try:
value_list = CONF._namespace._get_file_value([('keystone_authtoken',
name)])
if isinstance(value_list, tuple):
value_list = value_list[0]
cfg_val = value_list[0]
if name == "auth_url" and not re.findall(r'\/v[2-3].*', cfg_val):
cfg_val += "/v3"