diff --git a/manifests/cache.pp b/manifests/cache.pp index 3555017..9eeef26 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -235,12 +235,12 @@ # the HashClient's internal mechanisms. # Default to $facts['os_service_default'] # -# [*hashclient_retry_delay*] +# [*hashclient_retry_timeout*] # (Optional) Time in seconds that should pass between # retry attempts in the HashClient's internal mechanisms. # Default to $facts['os_service_default'] # -# [*dead_timeout*] +# [*hashclient_dead_timeout*] # (Optional) Time in seconds before attempting to add a node # back in the pool in the HashClient's internal mechanisms. # Default to $facts['os_service_default'] @@ -253,6 +253,18 @@ # (Optional) ensure state for package. # Defaults to 'present' # +# DEPRECATED PARAMETERS +# +# [*hashclient_retry_delay*] +# (Optional) Time in seconds that should pass between +# retry attempts in the HashClient's internal mechanisms. +# Default to undef +# +# [*dead_timeout*] +# (Optional) Time in seconds before attempting to add a node +# back in the pool in the HashClient's internal mechanisms. +# Default to undef +# define oslo::cache ( $config_prefix = $facts['os_service_default'], $expiration_time = $facts['os_service_default'], @@ -291,13 +303,32 @@ define oslo::cache ( $retry_attempts = $facts['os_service_default'], $retry_delay = $facts['os_service_default'], $hashclient_retry_attempts = $facts['os_service_default'], - $hashclient_retry_delay = $facts['os_service_default'], - $dead_timeout = $facts['os_service_default'], + $hashclient_retry_timeout = $facts['os_service_default'], + $hashclient_dead_timeout = $facts['os_service_default'], Boolean $manage_backend_package = true, Stdlib::Ensure::Package $package_ensure = present, + # DEPRECATED PARAMETERS + $hashclient_retry_delay = undef, + $dead_timeout = undef, ) { include oslo::params + if $hashclient_retry_delay != undef { + warning("The hashclient_retry_delay parameter is deprecated. \ +Use the hashclient_retry_timeout parameter instead.") + $hashclient_retry_delay_real = $hashclient_retry_delay + } else { + $hashclient_retry_delay_real = $facts['os_service_default'] + } + + if $dead_timeout != undef { + warning("The dead_timeout parameter is deprecated. \ +Use the hashclient_dead_timeout`` parameter instead.") + $dead_timeout_real = $dead_timeout + } else { + $dead_timeout_real = $facts['os_service_default'] + } + if is_service_default($memcache_servers) { $memcache_servers_real = $memcache_servers } else { @@ -400,8 +431,10 @@ define oslo::cache ( 'cache/retry_attempts' => { value => $retry_attempts }, 'cache/retry_delay' => { value => $retry_delay }, 'cache/hashclient_retry_attempts' => { value => $hashclient_retry_attempts }, - 'cache/hashclient_retry_delay' => { value => $hashclient_retry_delay }, - 'cache/dead_timeout' => { value => $dead_timeout }, + 'cache/hashclient_retry_timeout' => { value => $hashclient_retry_timeout }, + 'cache/hashclient_dead_timeout' => { value => $hashclient_dead_timeout }, + 'cache/hashclient_retry_delay' => { value => $hashclient_retry_delay_real }, + 'cache/dead_timeout' => { value => $dead_timeout_real }, } create_resources($name, $cache_options) } diff --git a/releasenotes/notes/cache-rename-haslclient-params-50e00d070bac41d9.yaml b/releasenotes/notes/cache-rename-haslclient-params-50e00d070bac41d9.yaml new file mode 100644 index 0000000..12dc0c7 --- /dev/null +++ b/releasenotes/notes/cache-rename-haslclient-params-50e00d070bac41d9.yaml @@ -0,0 +1,9 @@ +--- +deprecations: + - | + The ``oslo::cache::hashclient_retry_delay`` parameter was deprecated in + favor of the new ``hashclient_retry_timeout`` parameter. + + - | + The ``oslo::cache::dead_timeout`` parameter was deprecated in favor of + the new ``hashclient_dead_timeout`` parameter. diff --git a/spec/defines/oslo_cache_spec.rb b/spec/defines/oslo_cache_spec.rb index 25469dc..9593f65 100644 --- a/spec/defines/oslo_cache_spec.rb +++ b/spec/defines/oslo_cache_spec.rb @@ -45,6 +45,8 @@ describe 'oslo::cache' do is_expected.to contain_keystone_config('cache/retry_attempts').with_value('') is_expected.to contain_keystone_config('cache/retry_delay').with_value('') is_expected.to contain_keystone_config('cache/hashclient_retry_attempts').with_value('') + is_expected.to contain_keystone_config('cache/hashclient_retry_timeout').with_value('') + is_expected.to contain_keystone_config('cache/hashclient_dead_timeout').with_value('') is_expected.to contain_keystone_config('cache/hashclient_retry_delay').with_value('') is_expected.to contain_keystone_config('cache/dead_timeout').with_value('') end @@ -90,8 +92,10 @@ describe 'oslo::cache' do :retry_attempts => 2, :retry_delay => 0, :hashclient_retry_attempts => 2, - :hashclient_retry_delay => 1, - :dead_timeout => 60, + :hashclient_retry_timeout => 1, + :hashclient_dead_timeout => 60, + :hashclient_retry_delay => 3, + :dead_timeout => 61, } end @@ -133,8 +137,10 @@ describe 'oslo::cache' do is_expected.to contain_keystone_config('cache/retry_attempts').with_value('2') is_expected.to contain_keystone_config('cache/retry_delay').with_value('0') is_expected.to contain_keystone_config('cache/hashclient_retry_attempts').with_value('2') - is_expected.to contain_keystone_config('cache/hashclient_retry_delay').with_value('1') - is_expected.to contain_keystone_config('cache/dead_timeout').with_value('60') + is_expected.to contain_keystone_config('cache/hashclient_retry_timeout').with_value('1') + is_expected.to contain_keystone_config('cache/hashclient_dead_timeout').with_value('60') + is_expected.to contain_keystone_config('cache/hashclient_retry_delay').with_value('3') + is_expected.to contain_keystone_config('cache/dead_timeout').with_value('61') end end