From 9c705fb84721d85d388f564e79c6cd0285373f8f Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Thu, 14 Sep 2017 12:25:53 +0800 Subject: [PATCH] Deprecate revocation_cache_time option The revocation_cache_time is deprecated for removel because of PKI token format is no longer supported. Update warning message and add a release note. Change-Id: Ia9fd9b7af4b345715bbe233f9724383817f64686 Closes-Bug: #1717144 --- manifests/keystone/authtoken.pp | 24 ++++++++++++------- ...cache_time_parameter-833ea914b2355a29.yaml | 4 ++++ .../watcher_keystone_authtoken_spec.rb | 3 --- 3 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 releasenotes/notes/deprecate_revocation_cache_time_parameter-833ea914b2355a29.yaml diff --git a/manifests/keystone/authtoken.pp b/manifests/keystone/authtoken.pp index 2d7d1aa..991bdb7 100644 --- a/manifests/keystone/authtoken.pp +++ b/manifests/keystone/authtoken.pp @@ -174,19 +174,21 @@ # (Optional) The region in which the identity server can be found. # Defaults to $::os_service_default. # -# [*revocation_cache_time*] -# (Optional) Determines the frequency at which the list of revoked tokens is -# retrieved from the Identity service (in seconds). A high number of -# revocation events combined with a low cache duration may significantly -# reduce performance. Only valid for PKI tokens. Integer value -# Defaults to $::os_service_default. -# # [*token_cache_time*] # (Optional) In order to prevent excessive effort spent validating tokens, # the middleware caches previously-seen tokens for a configurable duration # (in seconds). Set to -1 to disable caching completely. Integer value # Defaults to $::os_service_default. # +# DEPRECATED PARAMETERS +# +# [*revocation_cache_time*] +# (Optional) Determines the frequency at which the list of revoked tokens is +# retrieved from the Identity service (in seconds). A high number of +# revocation events combined with a low cache duration may significantly +# reduce performance. Only valid for PKI tokens. Integer value +# Defaults to undef +# class watcher::keystone::authtoken ( $password = $::os_service_default, $username = 'watcher', @@ -221,8 +223,9 @@ class watcher::keystone::authtoken ( $memcached_servers = $::os_service_default, $manage_memcache_package = false, $region_name = $::os_service_default, - $revocation_cache_time = $::os_service_default, $token_cache_time = $::os_service_default, + # DEPRECATED PARAMETERS + $revocation_cache_time = undef, ) { include ::watcher::deps @@ -231,6 +234,10 @@ class watcher::keystone::authtoken ( fail('Please set password for watcher service user') } + if $revocation_cache_time { + warning('revocation_cache_time parameter is deprecated, has no effect and will be removed in the future.') + } + validate_string($password) keystone::resource::authtoken { 'watcher_config': @@ -267,7 +274,6 @@ class watcher::keystone::authtoken ( memcached_servers => $memcached_servers, manage_memcache_package => $manage_memcache_package, region_name => $region_name, - revocation_cache_time => $revocation_cache_time, token_cache_time => $token_cache_time, } diff --git a/releasenotes/notes/deprecate_revocation_cache_time_parameter-833ea914b2355a29.yaml b/releasenotes/notes/deprecate_revocation_cache_time_parameter-833ea914b2355a29.yaml new file mode 100644 index 0000000..438a913 --- /dev/null +++ b/releasenotes/notes/deprecate_revocation_cache_time_parameter-833ea914b2355a29.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - revocation_cache_time option is now deprecated for removal, the + parameter has no effect. diff --git a/spec/classes/watcher_keystone_authtoken_spec.rb b/spec/classes/watcher_keystone_authtoken_spec.rb index 62e0f44..62074f2 100644 --- a/spec/classes/watcher_keystone_authtoken_spec.rb +++ b/spec/classes/watcher_keystone_authtoken_spec.rb @@ -47,7 +47,6 @@ describe 'watcher::keystone::authtoken' do is_expected.to contain_watcher_config('keystone_authtoken/memcache_use_advanced_pool').with_value('') is_expected.to contain_watcher_config('keystone_authtoken/memcached_servers').with_value('') is_expected.to contain_watcher_config('keystone_authtoken/region_name').with_value('') - is_expected.to contain_watcher_config('keystone_authtoken/revocation_cache_time').with_value('') is_expected.to contain_watcher_config('keystone_authtoken/token_cache_time').with_value('') end end @@ -88,7 +87,6 @@ describe 'watcher::keystone::authtoken' do :memcached_servers => ['memcached01:11211','memcached02:11211'], :manage_memcache_package => true, :region_name => 'region2', - :revocation_cache_time => '11', :token_cache_time => '301', }) end @@ -126,7 +124,6 @@ describe 'watcher::keystone::authtoken' do is_expected.to contain_watcher_config('keystone_authtoken/memcache_use_advanced_pool').with_value(params[:memcache_use_advanced_pool]) is_expected.to contain_watcher_config('keystone_authtoken/memcached_servers').with_value('memcached01:11211,memcached02:11211') is_expected.to contain_watcher_config('keystone_authtoken/region_name').with_value(params[:region_name]) - is_expected.to contain_watcher_config('keystone_authtoken/revocation_cache_time').with_value(params[:revocation_cache_time]) is_expected.to contain_watcher_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time]) end