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: Id17d4e5c6079fffe04372fe0d1d86c7e2267f7c0
Closes-Bug: #1717144
This commit is contained in:
ZhongShengping 2017-09-14 11:54:33 +08:00
parent a4e0fca3c2
commit eb9743dfee
3 changed files with 26 additions and 19 deletions

View File

@ -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 sahara::keystone::authtoken(
$username = 'sahara',
$password = $::os_service_default,
@ -219,17 +221,22 @@ class sahara::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,
) {
#NOTE(emilien): Use pick to keep backward compatibility
$username_real = pick($::sahara::admin_user,$username)
$password_real = pick($::sahara::admin_password,$password)
$project_name_real = pick($::sahara::admin_tenant_name,$project_name)
$memcached_servers_real = pick($::sahara::memcached_servers,$memcached_servers)
$auth_uri_real = pick($::sahara::auth_uri,$auth_uri)
$auth_url_real = pick($::sahara::identity_uri,$auth_url)
#NOTE(emilien): Use pick to keep backward compatibility
$username_real = pick($::sahara::admin_user,$username)
$password_real = pick($::sahara::admin_password,$password)
$project_name_real = pick($::sahara::admin_tenant_name,$project_name)
$memcached_servers_real = pick($::sahara::memcached_servers,$memcached_servers)
$auth_uri_real = pick($::sahara::auth_uri,$auth_uri)
$auth_url_real = pick($::sahara::identity_uri,$auth_url)
if $revocation_cache_time {
warning('revocation_cache_time parameter is deprecated, has no effect and will be removed in the future.')
}
keystone::resource::authtoken { 'sahara_config':
username => $username_real,
@ -265,7 +272,6 @@ $auth_url_real = pick($::sahara::identity_uri,$auth_url)
memcached_servers => $memcached_servers_real,
manage_memcache_package => $manage_memcache_package,
region_name => $region_name,
revocation_cache_time => $revocation_cache_time,
token_cache_time => $token_cache_time,
}
}

View File

@ -0,0 +1,4 @@
---
deprecations:
- revocation_cache_time option is now deprecated for removal, the
parameter has no effect.

View File

@ -43,7 +43,6 @@ describe 'sahara::keystone::authtoken' do
is_expected.to contain_sahara_config('keystone_authtoken/memcache_use_advanced_pool').with_value('<SERVICE DEFAULT>')
is_expected.to contain_sahara_config('keystone_authtoken/memcached_servers').with_value('<SERVICE DEFAULT>')
is_expected.to contain_sahara_config('keystone_authtoken/region_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_sahara_config('keystone_authtoken/revocation_cache_time').with_value('<SERVICE DEFAULT>')
is_expected.to contain_sahara_config('keystone_authtoken/token_cache_time').with_value('<SERVICE DEFAULT>')
end
end
@ -86,7 +85,6 @@ describe 'sahara::keystone::authtoken' do
['memcached01:11211','memcached02:11211'],
:manage_memcache_package => true,
:region_name => 'region2',
:revocation_cache_time => '11',
:token_cache_time => '301',
})
end
@ -124,7 +122,6 @@ describe 'sahara::keystone::authtoken' do
is_expected.to contain_sahara_config('keystone_authtoken/memcache_use_advanced_pool').with_value(params[:memcache_use_advanced_pool])
is_expected.to contain_sahara_config('keystone_authtoken/memcached_servers').with_value('memcached01:11211,memcached02:11211')
is_expected.to contain_sahara_config('keystone_authtoken/region_name').with_value(params[:region_name])
is_expected.to contain_sahara_config('keystone_authtoken/revocation_cache_time').with_value(params[:revocation_cache_time])
is_expected.to contain_sahara_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time])
end