From cc0f66218f5679ac789e18007fddb1ea51c506e4 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Sat, 30 Jun 2018 22:38:28 +0000 Subject: [PATCH] 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 --- zun/common/keystone.py | 5 +++-- zun/conf/keystone.py | 2 -- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/zun/common/keystone.py b/zun/common/keystone.py index 377591186..cf4e27541 100644 --- a/zun/common/keystone.py +++ b/zun/common/keystone.py @@ -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): diff --git a/zun/conf/keystone.py b/zun/conf/keystone.py index 8c422007e..4394fd277 100644 --- a/zun/conf/keystone.py +++ b/zun/conf/keystone.py @@ -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():