From bc5b85357b2f6ac643d2124ea358e327c90ff979 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Wed, 28 Dec 2016 14:07:47 +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: I32ee73ea8a7d2bde856b226a76616e1ca291d92c Closes-Bug: #1652700 --- manifests/api/authtoken.pp | 18 ++++++++++++------ manifests/inspector/authtoken.pp | 18 ++++++++++++------ ...signing_dir_parameter-171235a2345ef589.yaml | 4 ++++ spec/classes/ironic_api_authtoken_spec.rb | 3 --- .../classes/ironic_inspector_authtoken_spec.rb | 3 --- 5 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 releasenotes/notes/deprecate_signing_dir_parameter-171235a2345ef589.yaml diff --git a/manifests/api/authtoken.pp b/manifests/api/authtoken.pp index 4fc150d6..20ca049d 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 ironic::api::authtoken( $username = 'ironic', $password = $::os_service_default, @@ -219,8 +221,9 @@ class ironic::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 ::ironic::deps @@ -229,6 +232,10 @@ class ironic::api::authtoken( fail('Please set password for Ironic API service user') } + if $signing_dir { + warning('signing_dir parameter is deprecated, has no effect and will be removed in the Pike release.') + } + keystone::resource::authtoken { 'ironic_config': username => $username, password => $password, @@ -263,7 +270,6 @@ class ironic::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/inspector/authtoken.pp b/manifests/inspector/authtoken.pp index 185fa2bc..d1284dcf 100644 --- a/manifests/inspector/authtoken.pp +++ b/manifests/inspector/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 ironic::inspector::authtoken( $username = 'ironic', $password = $::os_service_default, @@ -219,8 +221,9 @@ class ironic::inspector::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 ::ironic::deps @@ -229,6 +232,10 @@ class ironic::inspector::authtoken( fail('Please set password for Ironic Inspector service user') } + if $signing_dir { + warning('signing_dir parameter is deprecated, has no effect and will be removed in the Pike release.') + } + keystone::resource::authtoken { 'ironic_inspector_config': username => $username, password => $password, @@ -263,7 +270,6 @@ class ironic::inspector::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-171235a2345ef589.yaml b/releasenotes/notes/deprecate_signing_dir_parameter-171235a2345ef589.yaml new file mode 100644 index 00000000..9c3ade95 --- /dev/null +++ b/releasenotes/notes/deprecate_signing_dir_parameter-171235a2345ef589.yaml @@ -0,0 +1,4 @@ +--- +deprecations: + - signing_dir option is now deprecated for removal, the + parameter has no effect. diff --git a/spec/classes/ironic_api_authtoken_spec.rb b/spec/classes/ironic_api_authtoken_spec.rb index 1b4191a8..686f6f25 100644 --- a/spec/classes/ironic_api_authtoken_spec.rb +++ b/spec/classes/ironic_api_authtoken_spec.rb @@ -44,7 +44,6 @@ describe 'ironic::api::authtoken' do is_expected.to contain_ironic_config('keystone_authtoken/memcached_servers').with_value('') is_expected.to contain_ironic_config('keystone_authtoken/region_name').with_value('') is_expected.to contain_ironic_config('keystone_authtoken/revocation_cache_time').with_value('') - is_expected.to contain_ironic_config('keystone_authtoken/signing_dir').with_value('') is_expected.to contain_ironic_config('keystone_authtoken/token_cache_time').with_value('') end end @@ -85,7 +84,6 @@ describe 'ironic::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 'ironic::api::authtoken' do is_expected.to contain_ironic_config('keystone_authtoken/memcached_servers').with_value('memcached01:11211,memcached02:11211') is_expected.to contain_ironic_config('keystone_authtoken/region_name').with_value(params[:region_name]) is_expected.to contain_ironic_config('keystone_authtoken/revocation_cache_time').with_value(params[:revocation_cache_time]) - is_expected.to contain_ironic_config('keystone_authtoken/signing_dir').with_value(params[:signing_dir]) is_expected.to contain_ironic_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time]) end end diff --git a/spec/classes/ironic_inspector_authtoken_spec.rb b/spec/classes/ironic_inspector_authtoken_spec.rb index 91d9a4d8..ad7dd950 100644 --- a/spec/classes/ironic_inspector_authtoken_spec.rb +++ b/spec/classes/ironic_inspector_authtoken_spec.rb @@ -44,7 +44,6 @@ describe 'ironic::inspector::authtoken' do is_expected.to contain_ironic_inspector_config('keystone_authtoken/memcached_servers').with_value('') is_expected.to contain_ironic_inspector_config('keystone_authtoken/region_name').with_value('') is_expected.to contain_ironic_inspector_config('keystone_authtoken/revocation_cache_time').with_value('') - is_expected.to contain_ironic_inspector_config('keystone_authtoken/signing_dir').with_value('') is_expected.to contain_ironic_inspector_config('keystone_authtoken/token_cache_time').with_value('') end end @@ -85,7 +84,6 @@ describe 'ironic::inspector::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 'ironic::inspector::authtoken' do is_expected.to contain_ironic_inspector_config('keystone_authtoken/memcached_servers').with_value('memcached01:11211,memcached02:11211') is_expected.to contain_ironic_inspector_config('keystone_authtoken/region_name').with_value(params[:region_name]) is_expected.to contain_ironic_inspector_config('keystone_authtoken/revocation_cache_time').with_value(params[:revocation_cache_time]) - is_expected.to contain_ironic_inspector_config('keystone_authtoken/signing_dir').with_value(params[:signing_dir]) is_expected.to contain_ironic_inspector_config('keystone_authtoken/token_cache_time').with_value(params[:token_cache_time]) end end