From a56a82e01db49208c232670bce86e7d8cbe5a87e Mon Sep 17 00:00:00 2001 From: caoyuan Date: Wed, 11 Apr 2018 22:54:31 +0800 Subject: [PATCH] Update auth_uri option to www_authenticate_uri Option auth_uri from group keystone_authtoken is deprecated[1]. Use option www_authenticate_uri from group keystone_authtoken. [1]https://review.openstack.org/#/c/508522/ Change-Id: Ib6b29f53911e83c64945993f4d107eb20d2a56a9 --- devstack/lib/zun | 2 +- doc/source/install/compute-install-ubuntu.rst | 4 ++-- doc/source/install/controller-install-ubuntu.rst | 4 ++-- zun/api/hooks.py | 2 +- zun/common/keystone.py | 3 ++- zun/conf/keystone.py | 2 +- zun/tests/unit/common/test_clients.py | 3 ++- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/devstack/lib/zun b/devstack/lib/zun index 759a55e52..b9e65c675 100644 --- a/devstack/lib/zun +++ b/devstack/lib/zun @@ -208,7 +208,7 @@ function create_zun_conf { configure_auth_token_middleware $ZUN_CONF zun $ZUN_AUTH_CACHE_DIR iniset $ZUN_CONF keystone_auth auth_url $KEYSTONE_AUTH_URI_V3 - iniset $ZUN_CONF keystone_authtoken auth_uri $KEYSTONE_SERVICE_URI_V3 + iniset $ZUN_CONF keystone_authtoken www_authenticate_uri $KEYSTONE_SERVICE_URI_V3 iniset $ZUN_CONF keystone_authtoken auth_url $KEYSTONE_AUTH_URI_V3 iniset $ZUN_CONF keystone_authtoken auth_version v3 diff --git a/doc/source/install/compute-install-ubuntu.rst b/doc/source/install/compute-install-ubuntu.rst index 295b951a9..85c152207 100644 --- a/doc/source/install/compute-install-ubuntu.rst +++ b/doc/source/install/compute-install-ubuntu.rst @@ -110,7 +110,7 @@ Install and configure components [keystone_auth] memcached_servers = controller:11211 - auth_uri = http://controller:5000 + www_authenticate_uri = http://controller:5000 project_domain_name = default project_name = service user_domain_name = default @@ -132,7 +132,7 @@ Install and configure components [keystone_authtoken] ... memcached_servers = controller:11211 - auth_uri = http://controller:5000 + www_authenticate_uri= http://controller:5000 project_domain_name = default project_name = service user_domain_name = default diff --git a/doc/source/install/controller-install-ubuntu.rst b/doc/source/install/controller-install-ubuntu.rst index f1eee3c22..438412000 100644 --- a/doc/source/install/controller-install-ubuntu.rst +++ b/doc/source/install/controller-install-ubuntu.rst @@ -237,7 +237,7 @@ Install and configure components [keystone_auth] memcached_servers = controller:11211 - auth_uri = http://controller:5000 + www_authenticate_uri = http://controller:5000 project_domain_name = default project_name = service user_domain_name = default @@ -259,7 +259,7 @@ Install and configure components [keystone_authtoken] ... memcached_servers = controller:11211 - auth_uri = http://controller:5000 + www_authenticate_uri = http://controller:5000 project_domain_name = default project_name = service user_domain_name = default diff --git a/zun/api/hooks.py b/zun/api/hooks.py index 1f2d43b8e..43468ec30 100644 --- a/zun/api/hooks.py +++ b/zun/api/hooks.py @@ -58,7 +58,7 @@ class ContextHook(hooks.PecanHook): roles = headers.get('X-Roles', '').split(',') auth_token_info = state.request.environ.get('keystone.token_info') - auth_url = CONF.keystone_authtoken.auth_uri + auth_url = CONF.keystone_authtoken.www_authenticate_uri state.request.context = context.make_context( auth_token=auth_token, diff --git a/zun/common/keystone.py b/zun/common/keystone.py index 5ce29d7c2..377591186 100644 --- a/zun/common/keystone.py +++ b/zun/common/keystone.py @@ -38,7 +38,8 @@ 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].auth_uri.replace('v2.0', 'v3') + return CONF[ksconf.CFG_LEGACY_GROUP].www_authenticate_uri.replace( + 'v2.0', 'v3') @property def auth_token(self): diff --git a/zun/conf/keystone.py b/zun/conf/keystone.py index 5f39d55a4..8c422007e 100644 --- a/zun/conf/keystone.py +++ b/zun/conf/keystone.py @@ -25,7 +25,7 @@ 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('auth_uri', 'keystonemiddleware.auth_token', + conf.import_opt('www_authenticate_uri', 'keystonemiddleware.auth_token', group=CFG_LEGACY_GROUP) diff --git a/zun/tests/unit/common/test_clients.py b/zun/tests/unit/common/test_clients.py index f1a8a6a75..c4bda3699 100644 --- a/zun/tests/unit/common/test_clients.py +++ b/zun/tests/unit/common/test_clients.py @@ -25,7 +25,8 @@ class ClientsTest(base.BaseTestCase): def setUp(self): super(ClientsTest, self).setUp() - zun.conf.CONF.set_override('auth_uri', 'http://server.test:5000/v2.0', + zun.conf.CONF.set_override('www_authenticate_uri', + 'http://server.test:5000/v2.0', group='keystone_authtoken') zun.conf.CONF.import_opt('api_version', 'zun.conf.glance_client', group='glance_client')