Fall back to the legacy auth_uri option

In before, we switched from 'auth_uri' to 'www_authenticate_uri' [1]
in a backward-incompatible way, which breaks the legacy setup.
For example, if users install Zun with Pike or earlier version
of OpenStack, it will break.

This patch fixes it by fall back to the legacy option 'auth_uri'
if 'www_authenticate_uri' is not presented. In addition, a unnecessary
import_opt statement is removed.

[1] https://review.openstack.org/#/c/568457/

Change-Id: I5e3535f8dbfac73e56190442a31943ac22562ffb
This commit is contained in:
Hongbin Lu 2018-06-30 22:38:28 +00:00
parent 58f7b93258
commit cc0f66218f
2 changed files with 3 additions and 4 deletions

View File

@ -38,8 +38,9 @@ class KeystoneClientV3(object):
def auth_url(self):
# FIXME(pauloewerton): auth_url should be retrieved from keystone_auth
# section by default
return CONF[ksconf.CFG_LEGACY_GROUP].www_authenticate_uri.replace(
'v2.0', 'v3')
url = CONF[ksconf.CFG_LEGACY_GROUP].www_authenticate_uri or \
CONF[ksconf.CFG_LEGACY_GROUP].auth_uri
return url.replace('v2.0', 'v3')
@property
def auth_token(self):

View File

@ -25,8 +25,6 @@ def register_opts(conf):
ka_loading.register_auth_conf_options(conf, CFG_GROUP)
ka_loading.register_session_conf_options(conf, CFG_GROUP)
conf.set_default('auth_type', default='password', group=CFG_GROUP)
conf.import_opt('www_authenticate_uri', 'keystonemiddleware.auth_token',
group=CFG_LEGACY_GROUP)
def list_opts():