From 7a644489171230c3337aa0f4064ad1b8a14199ba Mon Sep 17 00:00:00 2001 From: "wu.chunyang" Date: Thu, 12 Apr 2018 21:47:40 +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: Ib8623a359a27b8a4aa90bf69a3fe3f3a5c2411a6 --- devstack/plugin.sh | 2 +- .../admin/deploy_murano/install_manually.rst | 2 +- .../configure_cloud_foundry_service_broker.rst | 2 +- doc/source/install/install-api.rst | 2 +- murano/cmd/test_runner.py | 2 +- murano/common/auth_utils.py | 14 ++++++++------ murano/common/config.py | 2 +- murano/tests/unit/common/test_auth_utils.py | 10 +++++----- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 29330d932..59fbb2ec1 100755 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -201,7 +201,7 @@ function configure_murano { # Setup murano_auth section configure_auth_token_middleware $MURANO_CONF_FILE $MURANO_ADMIN_USER $MURANO_AUTH_CACHE_DIR murano_auth - iniset $MURANO_CONF_FILE murano_auth auth_uri $KEYSTONE_AUTH_URI + iniset $MURANO_CONF_FILE murano_auth www_authenticate_uri $KEYSTONE_AUTH_URI configure_murano_rpc_backend diff --git a/doc/source/admin/deploy_murano/install_manually.rst b/doc/source/admin/deploy_murano/install_manually.rst index 32547766d..8da4b0264 100644 --- a/doc/source/admin/deploy_murano/install_manually.rst +++ b/doc/source/admin/deploy_murano/install_manually.rst @@ -118,7 +118,7 @@ Install the API service and engine ... [keystone_authtoken] - auth_uri = 'http://%OPENSTACK_HOST_IP%:5000' + www_authenticate_uri = 'http://%OPENSTACK_HOST_IP%:5000' auth_host = '%OPENSTACK_HOST_IP%' auth_port = 5000 auth_protocol = http diff --git a/doc/source/configuration/configure_cloud_foundry_service_broker.rst b/doc/source/configuration/configure_cloud_foundry_service_broker.rst index d795d660c..e6291eac1 100644 --- a/doc/source/configuration/configure_cloud_foundry_service_broker.rst +++ b/doc/source/configuration/configure_cloud_foundry_service_broker.rst @@ -69,7 +69,7 @@ broker in a few simple steps: ... [keystone_authtoken] - auth_uri = 'http://%OPENSTACK_HOST_IP%:5000/v3' + www_authenticate_uri = 'http://%OPENSTACK_HOST_IP%:5000/v3' auth_host = '%OPENSTACK_HOST_IP%' auth_port = 5000 auth_protocol = http diff --git a/doc/source/install/install-api.rst b/doc/source/install/install-api.rst index 2d32111ac..0871b67b6 100644 --- a/doc/source/install/install-api.rst +++ b/doc/source/install/install-api.rst @@ -115,7 +115,7 @@ Install the API service and Engine ... [keystone_authtoken] - auth_uri = 'http://%OPENSTACK_HOST_IP%:5000/v2.0' + www_authenticate_uri = 'http://%OPENSTACK_HOST_IP%:5000/v2.0' auth_host = '%OPENSTACK_HOST_IP%' auth_port = 5000 auth_protocol = http diff --git a/murano/cmd/test_runner.py b/murano/cmd/test_runner.py index 9fd64960f..a877f6377 100644 --- a/murano/cmd/test_runner.py +++ b/murano/cmd/test_runner.py @@ -165,7 +165,7 @@ class MuranoTestRunner(object): def _validate_keystone_opts(self, args): ks_opts_to_config = { - 'auth_url': 'auth_uri', + 'auth_url': 'www_authenticate_uri', 'username': 'admin_user', 'password': 'admin_password', 'project_name': 'admin_project_name'} diff --git a/murano/common/auth_utils.py b/murano/common/auth_utils.py index f544f9d0d..c1102a4f3 100644 --- a/murano/common/auth_utils.py +++ b/murano/common/auth_utils.py @@ -65,13 +65,15 @@ def get_client_session(execution_session=None, conf=None): def get_token_client_session(token=None, project_id=None, conf=None): - auth_uri = cfg.CONF[CFG_MURANO_AUTH_GROUP].auth_uri - if not auth_uri: + www_authenticate_uri = \ + cfg.CONF[CFG_MURANO_AUTH_GROUP].www_authenticate_uri + if not www_authenticate_uri: versionutils.report_deprecated_feature( - LOG, 'Please configure auth_uri in ' + CFG_MURANO_AUTH_GROUP + - ' group') - auth_uri = cfg.CONF[CFG_KEYSTONE_GROUP].auth_uri - auth_url = auth_uri.replace('v2.0', 'v3') + LOG, 'Please configure www_authenticate_uri in ' + + CFG_MURANO_AUTH_GROUP + 'group') + www_authenticate_uri = \ + cfg.CONF[CFG_KEYSTONE_GROUP].www_authenticate_uri + auth_url = www_authenticate_uri.replace('v2.0', 'v3') if token is None or project_id is None: execution_session = helpers.get_execution_session() token = execution_session.token diff --git a/murano/common/config.py b/murano/common/config.py index 9c56196e2..0686b533e 100644 --- a/murano/common/config.py +++ b/murano/common/config.py @@ -263,7 +263,7 @@ home_region = cfg.StrOpt( # Unfortuntely we cannot use murano_auth.auth_url, since it # is private to the actual authentication plugin used. murano_auth_opts = [ - cfg.StrOpt('auth_uri', + cfg.StrOpt('www_authenticate_uri', help='Identity API endpoint for authenticating with tokens.')] diff --git a/murano/tests/unit/common/test_auth_utils.py b/murano/tests/unit/common/test_auth_utils.py index 5c0dcfac4..ba9d4f117 100644 --- a/murano/tests/unit/common/test_auth_utils.py +++ b/murano/tests/unit/common/test_auth_utils.py @@ -48,8 +48,8 @@ class TestAuthUtils(base.MuranoTestCase): cfg.CONF.set_override('auth_type', 'password', auth_utils.CFG_MURANO_AUTH_GROUP) - cfg.CONF.set_override('auth_uri', - 'foo_auth_uri', + cfg.CONF.set_override('www_authenticate_uri', + 'foo_www_authenticate_uri', auth_utils.CFG_MURANO_AUTH_GROUP) cfg.CONF.set_override('auth_url', 'foo_auth_url', @@ -158,8 +158,8 @@ class TestAuthUtils(base.MuranoTestCase): def test_get_token_client_session( self, mock_get_execution_session, mock_identity, mock_get_session): - cfg.CONF.set_override('auth_uri', - 'foo_auth_uri/v2.0', + cfg.CONF.set_override('www_authenticate_uri', + 'foo_www_authenticate_uri/v2.0', auth_utils.CFG_MURANO_AUTH_GROUP) mock_get_execution_session.return_value = \ @@ -173,7 +173,7 @@ class TestAuthUtils(base.MuranoTestCase): mock_get_execution_session.assert_called_once_with() mock_identity.Token.assert_called_once_with( - 'foo_auth_uri/v3', token=mock.sentinel.token, + 'foo_www_authenticate_uri/v3', token=mock.sentinel.token, project_id=mock.sentinel.project_id) mock_get_session.assert_called_once_with( auth=mock.sentinel.auth,