From c5697efc43965b2bed0ff2b4fccc7f69f173be3f Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Tue, 3 Apr 2018 16:55:00 +0800 Subject: [PATCH] Deprecate auth_uri option 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: Ie7a5a791f7fafaf9bd60aea2e6bd84e5f9c3f68f Depends-On: I4c82a63baabd6b9304b302c97cd751a0103d8316 Closes-Bug: #1759098 --- manifests/keystone/authtoken.pp | 19 ++++++++++++++++--- ...e_auth_uri_parameter-8c31ce05b70ef0d6.yaml | 4 ++++ .../classes/ec2api_keystone_authtoken_spec.rb | 6 +++--- 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/deprecate_auth_uri_parameter-8c31ce05b70ef0d6.yaml diff --git a/manifests/keystone/authtoken.pp b/manifests/keystone/authtoken.pp index 1bc61ff..cb45f4e 100644 --- a/manifests/keystone/authtoken.pp +++ b/manifests/keystone/authtoken.pp @@ -41,7 +41,7 @@ # (Optional) Authentication type to load # Defaults to 'password' # -# [*auth_uri*] +# [*www_authenticate_uri*] # (Optional) Complete public Identity API endpoint. # Defaults to 'http://localhost:5000' # @@ -177,6 +177,12 @@ # (in seconds). Set to -1 to disable caching completely. Integer value # Defaults to $::os_service_default. # +# DEPRECATED PARAMETERS +# +# [*auth_uri*] +# (Optional) Complete public Identity API endpoint. +# Defaults to undef +# class ec2api::keystone::authtoken( $password, $username = 'ec2api', @@ -187,7 +193,7 @@ class ec2api::keystone::authtoken( $insecure = $::os_service_default, $auth_section = $::os_service_default, $auth_type = 'password', - $auth_uri = 'http://localhost:5000', + $www_authenticate_uri = 'http://localhost:5000', $auth_version = $::os_service_default, $cache = $::os_service_default, $cafile = $::os_service_default, @@ -212,16 +218,23 @@ class ec2api::keystone::authtoken( $manage_memcache_package = false, $region_name = $::os_service_default, $token_cache_time = $::os_service_default, + # DEPRECATED PARAMETERS + $auth_uri = undef, ) { include ::ec2api::deps + if $auth_uri { + warning('The auth_uri parameter is deprecated. Please use www_authenticate_uri instead.') + } + $www_authenticate_uri_real = pick($auth_uri, $www_authenticate_uri) + keystone::resource::authtoken { 'ec2api_config': username => $username, password => $password, project_name => $project_name, auth_url => $auth_url, - auth_uri => $auth_uri, + www_authenticate_uri => $www_authenticate_uri_real, auth_version => $auth_version, auth_type => $auth_type, auth_section => $auth_section, diff --git a/releasenotes/notes/deprecate_auth_uri_parameter-8c31ce05b70ef0d6.yaml b/releasenotes/notes/deprecate_auth_uri_parameter-8c31ce05b70ef0d6.yaml new file mode 100644 index 0000000..86d56c0 --- /dev/null +++ b/releasenotes/notes/deprecate_auth_uri_parameter-8c31ce05b70ef0d6.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - auth_uri is deprecated and will be removed in a future release. + Please use www_authenticate_uri instead. diff --git a/spec/classes/ec2api_keystone_authtoken_spec.rb b/spec/classes/ec2api_keystone_authtoken_spec.rb index 64a5014..42d753d 100644 --- a/spec/classes/ec2api_keystone_authtoken_spec.rb +++ b/spec/classes/ec2api_keystone_authtoken_spec.rb @@ -24,7 +24,7 @@ describe 'ec2api::keystone::authtoken' do is_expected.to contain_ec2api_config('keystone_authtoken/insecure').with_value('') is_expected.to contain_ec2api_config('keystone_authtoken/auth_section').with_value('') is_expected.to contain_ec2api_config('keystone_authtoken/auth_type').with_value('password') - is_expected.to contain_ec2api_config('keystone_authtoken/auth_uri').with_value('http://localhost:5000') + is_expected.to contain_ec2api_config('keystone_authtoken/www_authenticate_uri').with_value('http://localhost:5000') is_expected.to contain_ec2api_config('keystone_authtoken/auth_version').with_value('') is_expected.to contain_ec2api_config('keystone_authtoken/cache').with_value('') is_expected.to contain_ec2api_config('keystone_authtoken/cafile').with_value('') @@ -54,7 +54,7 @@ describe 'ec2api::keystone::authtoken' do context 'when overriding parameters' do before do params.merge!({ - :auth_uri => 'https://10.0.0.1:9999/', + :www_authenticate_uri => 'https://10.0.0.1:9999/', :username => 'myuser', :password => 'mypasswd', :auth_url => 'http://:127.0.0.1:35357', @@ -94,7 +94,7 @@ describe 'ec2api::keystone::authtoken' do end it 'configure keystone_authtoken' do - is_expected.to contain_ec2api_config('keystone_authtoken/auth_uri').with_value('https://10.0.0.1:9999/') + is_expected.to contain_ec2api_config('keystone_authtoken/www_authenticate_uri').with_value('https://10.0.0.1:9999/') is_expected.to contain_ec2api_config('keystone_authtoken/username').with_value(params[:username]) is_expected.to contain_ec2api_config('keystone_authtoken/password').with_value(params[:password]).with_secret(true) is_expected.to contain_ec2api_config('keystone_authtoken/auth_url').with_value(params[:auth_url])