From 9ce30c3f55cc2e1b035a2358446b5134a9286d64 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Thu, 14 Sep 2017 11:25:40 +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: Ia607af51a784113541ac576b9293700dbafba31d Closes-Bug: #1717144 --- manifests/api/authtoken.pp | 24 ++++++++++++------- manifests/registry/authtoken.pp | 24 ++++++++++++------- ...cache_time_parameter-df18d6b775848d64.yaml | 4 ++++ spec/classes/glance_api_authtoken_spec.rb | 3 --- .../classes/glance_registry_authtoken_spec.rb | 3 --- 5 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 releasenotes/notes/deprecate_revocation_cache_time_parameter-df18d6b775848d64.yaml diff --git a/manifests/api/authtoken.pp b/manifests/api/authtoken.pp index e974b96b..42e1ded6 100644 --- a/manifests/api/authtoken.pp +++ b/manifests/api/authtoken.pp @@ -172,19 +172,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 glance::api::authtoken( $username = 'glance', $password = $::os_service_default, @@ -219,8 +221,9 @@ class glance::api::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 ::glance::deps @@ -229,6 +232,10 @@ class glance::api::authtoken( fail('Please set password for Glance service user') } + if $revocation_cache_time { + warning('revocation_cache_time parameter is deprecated, has no effect and will be removed in the future.') + } + keystone::resource::authtoken { 'glance_api_config': username => $username, password => $password, @@ -263,7 +270,6 @@ class glance::api::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/manifests/registry/authtoken.pp b/manifests/registry/authtoken.pp index 5e596950..03ab11e0 100644 --- a/manifests/registry/authtoken.pp +++ b/manifests/registry/authtoken.pp @@ -172,19 +172,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 glance::registry::authtoken( $username = 'glance', $password = $::os_service_default, @@ -219,8 +221,9 @@ class glance::registry::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 ::glance::deps @@ -229,6 +232,10 @@ class glance::registry::authtoken( fail('Please set password for Glance service user') } + if $revocation_cache_time { + warning('revocation_cache_time parameter is deprecated, has no effect and will be removed in the future.') + } + keystone::resource::authtoken { 'glance_registry_config': username => $username, password => $password, @@ -263,7 +270,6 @@ class glance::registry::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-df18d6b775848d64.yaml b/releasenotes/notes/deprecate_revocation_cache_time_parameter-df18d6b775848d64.yaml new file mode 100644 index 00000000..438a9136 --- /dev/null +++ b/releasenotes/notes/deprecate_revocation_cache_time_parameter-df18d6b775848d64.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/glance_api_authtoken_spec.rb b/spec/classes/glance_api_authtoken_spec.rb index f6e4e0a4..5d8565eb 100644 --- a/spec/classes/glance_api_authtoken_spec.rb +++ b/spec/classes/glance_api_authtoken_spec.rb @@ -43,7 +43,6 @@ describe 'glance::api::authtoken' do is_expected.to contain_glance_api_config('keystone_authtoken/memcache_use_advanced_pool').with_value('') is_expected.to contain_glance_api_config('keystone_authtoken/memcached_servers').with_value('') is_expected.to contain_glance_api_config('keystone_authtoken/region_name').with_value('') - is_expected.to contain_glance_api_config('keystone_authtoken/revocation_cache_time').with_value('') is_expected.to contain_glance_api_config('keystone_authtoken/token_cache_time').with_value('') end end @@ -84,7 +83,6 @@ describe 'glance::api::authtoken' do :memcached_servers => ['memcached01:11211','memcached02:11211'], :manage_memcache_package => true, :region_name => 'region2', - :revocation_cache_time => '11', :token_cache_time => '301', }) end @@ -122,7 +120,6 @@ describe 'glance::api::authtoken' do is_expected.to contain_glance_api_config('keystone_authtoken/memcache_use_advanced_pool').with_value(params[:memcache_use_advanced_pool]) is_expected.to contain_glance_api_config('keystone_authtoken/memcached_servers').with_value('memcached01:11211,memcached02:11211') is_expected.to contain_glance_api_config('keystone_authtoken/region_name').with_value(params[:region_name]) - is_expected.to contain_glance_api_config('keystone_authtoken/revocation_cache_time').with_value(params[:revocation_cache_time]) is_expected.to contain_glance_api_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time]) end diff --git a/spec/classes/glance_registry_authtoken_spec.rb b/spec/classes/glance_registry_authtoken_spec.rb index 9687f804..a1d719f6 100644 --- a/spec/classes/glance_registry_authtoken_spec.rb +++ b/spec/classes/glance_registry_authtoken_spec.rb @@ -43,7 +43,6 @@ describe 'glance::registry::authtoken' do is_expected.to contain_glance_registry_config('keystone_authtoken/memcache_use_advanced_pool').with_value('') is_expected.to contain_glance_registry_config('keystone_authtoken/memcached_servers').with_value('') is_expected.to contain_glance_registry_config('keystone_authtoken/region_name').with_value('') - is_expected.to contain_glance_registry_config('keystone_authtoken/revocation_cache_time').with_value('') is_expected.to contain_glance_registry_config('keystone_authtoken/token_cache_time').with_value('') end end @@ -84,7 +83,6 @@ describe 'glance::registry::authtoken' do :memcached_servers => ['memcached01:11211','memcached02:11211'], :manage_memcache_package => true, :region_name => 'region2', - :revocation_cache_time => '11', :token_cache_time => '301', }) end @@ -122,7 +120,6 @@ describe 'glance::registry::authtoken' do is_expected.to contain_glance_registry_config('keystone_authtoken/memcache_use_advanced_pool').with_value(params[:memcache_use_advanced_pool]) is_expected.to contain_glance_registry_config('keystone_authtoken/memcached_servers').with_value('memcached01:11211,memcached02:11211') is_expected.to contain_glance_registry_config('keystone_authtoken/region_name').with_value(params[:region_name]) - is_expected.to contain_glance_registry_config('keystone_authtoken/revocation_cache_time').with_value(params[:revocation_cache_time]) is_expected.to contain_glance_registry_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time]) end