From e6a6df773bdde714e10c9f43c53c03d7e045bcef Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Wed, 28 Dec 2016 09:02:42 +0800 Subject: [PATCH] Deprecate signing_dir option The signing_dir is deprecated for removel because of PKI token format is no longer supported. Update warning message and release note. Change-Id: Ifaad2dffab360df2790dac8d9ad8c9a87f719f6b Closes-Bug: #1652700 --- manifests/api/authtoken.pp | 18 ++++++++++++------ manifests/glare/authtoken.pp | 18 ++++++++++++------ manifests/registry/authtoken.pp | 18 ++++++++++++------ ...signing_dir_parameter-813569a35f3661e9.yaml | 4 ++++ spec/classes/glance_api_authtoken_spec.rb | 3 --- spec/classes/glance_glare_authtoken_spec.rb | 3 --- spec/classes/glance_registry_authtoken_spec.rb | 3 --- 7 files changed, 40 insertions(+), 27 deletions(-) create mode 100644 releasenotes/notes/deprecate_signing_dir_parameter-813569a35f3661e9.yaml diff --git a/manifests/api/authtoken.pp b/manifests/api/authtoken.pp index 13b60832..d33a9335 100644 --- a/manifests/api/authtoken.pp +++ b/manifests/api/authtoken.pp @@ -175,16 +175,18 @@ # reduce performance. Only valid for PKI tokens. Integer value # Defaults to $::os_service_default. # -# [*signing_dir*] -# (Optional) Directory used to cache files related to PKI tokens. -# 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 +# +# [*signing_dir*] +# (Optional) Directory used to cache files related to PKI tokens. +# 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, $region_name = $::os_service_default, $revocation_cache_time = $::os_service_default, - $signing_dir = $::os_service_default, $token_cache_time = $::os_service_default, + # DEPRECATED PARAMETERS + $signing_dir = undef, ) { include ::glance::deps @@ -229,6 +232,10 @@ class glance::api::authtoken( fail('Please set password for Glance service user') } + if $signing_dir { + warning('signing_dir parameter is deprecated, has no effect and will be removed in the P release.') + } + keystone::resource::authtoken { 'glance_api_config': username => $username, password => $password, @@ -263,7 +270,6 @@ class glance::api::authtoken( memcached_servers => $memcached_servers, region_name => $region_name, revocation_cache_time => $revocation_cache_time, - signing_dir => $signing_dir, token_cache_time => $token_cache_time, } } diff --git a/manifests/glare/authtoken.pp b/manifests/glare/authtoken.pp index 9ca09b1f..a9532ccc 100644 --- a/manifests/glare/authtoken.pp +++ b/manifests/glare/authtoken.pp @@ -175,16 +175,18 @@ # reduce performance. Only valid for PKI tokens. Integer value # Defaults to $::os_service_default. # -# [*signing_dir*] -# (Optional) Directory used to cache files related to PKI tokens. -# 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 +# +# [*signing_dir*] +# (Optional) Directory used to cache files related to PKI tokens. +# Defaults to undef +# class glance::glare::authtoken( $username = 'glance', $password = $::os_service_default, @@ -219,14 +221,19 @@ class glance::glare::authtoken( $memcached_servers = $::os_service_default, $region_name = $::os_service_default, $revocation_cache_time = $::os_service_default, - $signing_dir = $::os_service_default, $token_cache_time = $::os_service_default, + # DEPRECATED PARAMETERS + $signing_dir = undef, ) { if is_service_default($password) and $::glance::glare::keystone_password == undef { fail('Please set password for Glance service user') } + if $signing_dir { + warning('signing_dir parameter is deprecated, has no effect and will be removed in the P release.') + } + keystone::resource::authtoken { 'glance_glare_config': username => $username, password => $password, @@ -261,7 +268,6 @@ class glance::glare::authtoken( memcached_servers => $memcached_servers, region_name => $region_name, revocation_cache_time => $revocation_cache_time, - signing_dir => $signing_dir, token_cache_time => $token_cache_time, } } diff --git a/manifests/registry/authtoken.pp b/manifests/registry/authtoken.pp index 8d194ee5..382a9c4e 100644 --- a/manifests/registry/authtoken.pp +++ b/manifests/registry/authtoken.pp @@ -175,16 +175,18 @@ # reduce performance. Only valid for PKI tokens. Integer value # Defaults to $::os_service_default. # -# [*signing_dir*] -# (Optional) Directory used to cache files related to PKI tokens. -# 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 +# +# [*signing_dir*] +# (Optional) Directory used to cache files related to PKI tokens. +# 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, $region_name = $::os_service_default, $revocation_cache_time = $::os_service_default, - $signing_dir = $::os_service_default, $token_cache_time = $::os_service_default, + # DEPRECATED PARAMETERS + $signing_dir = undef, ) { include ::glance::deps @@ -229,6 +232,10 @@ class glance::registry::authtoken( fail('Please set password for Glance service user') } + if $signing_dir { + warning('signing_dir parameter is deprecated, has no effect and will be removed in the P release.') + } + keystone::resource::authtoken { 'glance_registry_config': username => $username, password => $password, @@ -263,7 +270,6 @@ class glance::registry::authtoken( memcached_servers => $memcached_servers, region_name => $region_name, revocation_cache_time => $revocation_cache_time, - signing_dir => $signing_dir, token_cache_time => $token_cache_time, } } diff --git a/releasenotes/notes/deprecate_signing_dir_parameter-813569a35f3661e9.yaml b/releasenotes/notes/deprecate_signing_dir_parameter-813569a35f3661e9.yaml new file mode 100644 index 00000000..9c3ade95 --- /dev/null +++ b/releasenotes/notes/deprecate_signing_dir_parameter-813569a35f3661e9.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - signing_dir 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 94b61ba8..7b97e94a 100644 --- a/spec/classes/glance_api_authtoken_spec.rb +++ b/spec/classes/glance_api_authtoken_spec.rb @@ -44,7 +44,6 @@ describe 'glance::api::authtoken' do 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/signing_dir').with_value('') is_expected.to contain_glance_api_config('keystone_authtoken/token_cache_time').with_value('') end end @@ -85,7 +84,6 @@ describe 'glance::api::authtoken' do :memcached_servers => ['memcached01:11211','memcached02:11211'], :region_name => 'region2', :revocation_cache_time => '11', - :signing_dir => '/var/cache', :token_cache_time => '301', }) end @@ -124,7 +122,6 @@ describe 'glance::api::authtoken' do 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/signing_dir').with_value(params[:signing_dir]) is_expected.to contain_glance_api_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time]) end end diff --git a/spec/classes/glance_glare_authtoken_spec.rb b/spec/classes/glance_glare_authtoken_spec.rb index 82ee4674..53c8e68c 100644 --- a/spec/classes/glance_glare_authtoken_spec.rb +++ b/spec/classes/glance_glare_authtoken_spec.rb @@ -44,7 +44,6 @@ describe 'glance::glare::authtoken' do is_expected.to contain_glance_glare_config('keystone_authtoken/memcached_servers').with_value('') is_expected.to contain_glance_glare_config('keystone_authtoken/region_name').with_value('') is_expected.to contain_glance_glare_config('keystone_authtoken/revocation_cache_time').with_value('') - is_expected.to contain_glance_glare_config('keystone_authtoken/signing_dir').with_value('') is_expected.to contain_glance_glare_config('keystone_authtoken/token_cache_time').with_value('') end end @@ -85,7 +84,6 @@ describe 'glance::glare::authtoken' do :memcached_servers => ['memcached01:11211','memcached02:11211'], :region_name => 'region2', :revocation_cache_time => '11', - :signing_dir => '/var/cache', :token_cache_time => '301', }) end @@ -124,7 +122,6 @@ describe 'glance::glare::authtoken' do is_expected.to contain_glance_glare_config('keystone_authtoken/memcached_servers').with_value('memcached01:11211,memcached02:11211') is_expected.to contain_glance_glare_config('keystone_authtoken/region_name').with_value(params[:region_name]) is_expected.to contain_glance_glare_config('keystone_authtoken/revocation_cache_time').with_value(params[:revocation_cache_time]) - is_expected.to contain_glance_glare_config('keystone_authtoken/signing_dir').with_value(params[:signing_dir]) is_expected.to contain_glance_glare_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time]) end end diff --git a/spec/classes/glance_registry_authtoken_spec.rb b/spec/classes/glance_registry_authtoken_spec.rb index 5387cb17..e8b3bf7f 100644 --- a/spec/classes/glance_registry_authtoken_spec.rb +++ b/spec/classes/glance_registry_authtoken_spec.rb @@ -44,7 +44,6 @@ describe 'glance::registry::authtoken' do 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/signing_dir').with_value('') is_expected.to contain_glance_registry_config('keystone_authtoken/token_cache_time').with_value('') end end @@ -85,7 +84,6 @@ describe 'glance::registry::authtoken' do :memcached_servers => ['memcached01:11211','memcached02:11211'], :region_name => 'region2', :revocation_cache_time => '11', - :signing_dir => '/var/cache', :token_cache_time => '301', }) end @@ -124,7 +122,6 @@ describe 'glance::registry::authtoken' do 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/signing_dir').with_value(params[:signing_dir]) is_expected.to contain_glance_registry_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time]) end end