From a8e2dc6891cc36209d947da06137cd450e9711af Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 19 Jun 2022 21:50:29 +0900 Subject: [PATCH] Clean up deprecated cache parameters These parameters were deprecated during Yoga cycle[1]. [1] a7cf7060ddfeab7440bf2e84522d220014c10bd8 Change-Id: I0358678a9298dfceb9c4ebf918ef334f0f5e496d --- manifests/cache.pp | 55 +++---- manifests/init.pp | 142 ------------------ ...nup-cache-parameters-87dfad09ecabd187.yaml | 25 +++ spec/classes/ceilometer_init_spec.rb | 63 -------- 4 files changed, 43 insertions(+), 242 deletions(-) create mode 100644 releasenotes/notes/cleanup-cache-parameters-87dfad09ecabd187.yaml diff --git a/manifests/cache.pp b/manifests/cache.pp index 42e9749..e6b55db 100644 --- a/manifests/cache.pp +++ b/manifests/cache.pp @@ -205,54 +205,35 @@ class ceilometer::cache ( include ceilometer::deps - $backend_real = pick($::ceilometer::cache_backend, $backend) - $memcache_servers_real = pick($::ceilometer::memcache_servers, $memcache_servers) - $enable_socket_keepalive_real = pick($::ceilometer::cache_enable_socket_keepalive, $enable_socket_keepalive) - $socket_keepalive_idle_real = pick($::ceilometer::cache_socket_keepalive_idle, $socket_keepalive_idle) - $socket_keepalive_interval_real = pick($::ceilometer::cache_socket_keepalive_interval, $socket_keepalive_interval) - $socket_keepalive_count_real = pick($::ceilometer::cache_socket_keepalive_count, $socket_keepalive_count) - $manage_backend_package_real = pick($::ceilometer::manage_backend_package, $manage_backend_package) - $tls_enabled_real = pick($::ceilometer::cache_tls_enabled, $tls_enabled) - $tls_cafile_real = pick($::ceilometer::cache_tls_cafile, $tls_cafile) - $tls_certfile_real = pick($::ceilometer::cache_tls_certfile, $tls_certfile) - $tls_keyfile_real = pick($::ceilometer::cache_tls_keyfile, $tls_keyfile) - $tls_allowed_ciphers_real = pick($::ceilometer::cache_tls_allowed_ciphers, $tls_allowed_ciphers) - $enable_retry_client_real = pick($::ceilometer::cache_enable_retry_client, $enable_retry_client) - $retry_attempts_real = pick($::ceilometer::cache_retry_attempts, $retry_attempts) - $retry_delay_real = pick($::ceilometer::cache_retry_delay, $retry_delay) - $hashclient_retry_attempts_real = pick($::ceilometer::cache_hashclient_retry_attempts, $hashclient_retry_attempts) - $hashclient_retry_delay_real = pick($::ceilometer::cache_hashclient_retry_delay, $hashclient_retry_delay) - $dead_timeout_real = pick($::ceilometer::cache_dead_timeout, $dead_timeout) - oslo::cache { 'ceilometer_config': config_prefix => $config_prefix, expiration_time => $expiration_time, - backend => $backend_real, + backend => $backend, backend_argument => $backend_argument, proxies => $proxies, enabled => $enabled, debug_cache_backend => $debug_cache_backend, - memcache_servers => $memcache_servers_real, + memcache_servers => $memcache_servers, memcache_dead_retry => $memcache_dead_retry, memcache_socket_timeout => $memcache_socket_timeout, - enable_socket_keepalive => $enable_socket_keepalive_real, - socket_keepalive_idle => $socket_keepalive_idle_real, - socket_keepalive_interval => $socket_keepalive_interval_real, - socket_keepalive_count => $socket_keepalive_count_real, + enable_socket_keepalive => $enable_socket_keepalive, + socket_keepalive_idle => $socket_keepalive_idle, + socket_keepalive_interval => $socket_keepalive_interval, + socket_keepalive_count => $socket_keepalive_count, memcache_pool_maxsize => $memcache_pool_maxsize, memcache_pool_unused_timeout => $memcache_pool_unused_timeout, memcache_pool_connection_get_timeout => $memcache_pool_connection_get_timeout, - manage_backend_package => $manage_backend_package_real, - tls_enabled => $tls_enabled_real, - tls_cafile => $tls_cafile_real, - tls_certfile => $tls_certfile_real, - tls_keyfile => $tls_keyfile_real, - tls_allowed_ciphers => $tls_allowed_ciphers_real, - enable_retry_client => $enable_retry_client_real, - retry_attempts => $retry_attempts_real, - retry_delay => $retry_delay_real, - hashclient_retry_attempts => $hashclient_retry_attempts_real, - hashclient_retry_delay => $hashclient_retry_delay_real, - dead_timeout => $dead_timeout_real, + manage_backend_package => $manage_backend_package, + tls_enabled => $tls_enabled, + tls_cafile => $tls_cafile, + tls_certfile => $tls_certfile, + tls_keyfile => $tls_keyfile, + tls_allowed_ciphers => $tls_allowed_ciphers, + enable_retry_client => $enable_retry_client, + retry_attempts => $retry_attempts, + retry_delay => $retry_delay, + hashclient_retry_attempts => $hashclient_retry_attempts, + hashclient_retry_delay => $hashclient_retry_delay, + dead_timeout => $dead_timeout, } } diff --git a/manifests/init.pp b/manifests/init.pp index 28a437d..7938a92 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -210,104 +210,6 @@ # # DEPRECATED PARAMETERS # -# [*cache_backend*] -# (Optional) The backend to pass to oslo::cache. -# Defaults to undef. -# -# [*memcache_servers*] -# (Optional) A list of memcached server(s) to use for caching. (list value) -# Defaults to undef -# -# [*cache_enable_socket_keepalive*] -# (Optional) Global toggle for the socket keepalive of dogpile's -# pymemcache backend -# Defaults to undef -# -# [*cache_socket_keepalive_idle*] -# (Optional) The time (in seconds) the connection needs to remain idle -# before TCP starts sending keepalive probes. Should be a positive integer -# most greater than zero. -# Defaults to undef -# -# [*cache_socket_keepalive_interval*] -# (Optional) The time (in seconds) between individual keepalive probes. -# Should be a positive integer most greater than zero. -# Defaults to undef -# -# [*cache_socket_keepalive_count*] -# (Optional) The maximum number of keepalive probes TCP should send before -# dropping the connection. Should be a positive integer most greater than -# zero. -# Defaults to undef -# -# [*cache_tls_enabled*] -# (Optional) Global toggle for TLS usage when communicating with -# the caching servers. -# Default to undef -# -# [*cache_tls_cafile*] -# (Optional) Path to a file of concatenated CA certificates in PEM -# format necessary to establish the caching server's authenticity. -# If tls_enabled is False, this option is ignored. -# Default to undef -# -# [*cache_tls_certfile*] -# (Optional) Path to a single file in PEM format containing the -# client's certificate as well as any number of CA certificates -# needed to establish the certificate's authenticity. This file -# is only required when client side authentication is necessary. -# If tls_enabled is False, this option is ignored. -# Default to undef -# -# [*cache_tls_keyfile*] -# (Optional) Path to a single file containing the client's private -# key in. Otherwise the private key will be taken from the file -# specified in tls_certfile. If tls_enabled is False, this option -# is ignored. -# Default to undef -# -# [*cache_tls_allowed_ciphers*] -# (Optional) Set the available ciphers for sockets created with -# the TLS context. It should be a string in the OpenSSL cipher -# list format. If not specified, all OpenSSL enabled ciphers will -# be available. -# Default to undef -# -# [*cache_enable_retry_client*] -# (Optional) Enable retry client mechanisms to handle failure. -# Those mechanisms can be used to wrap all kind of pymemcache -# clients. The wrapper allows you to define how many attempts -# to make and how long to wait between attempts. -# Default to undef -# -# [*cache_retry_attempts*] -# (Optional) Number of times to attempt an action before failing. -# Default to undef -# -# [*cache_retry_delay*] -# (Optional) Number of seconds to sleep between each attempt. -# Default to undef -# -# [*cache_hashclient_retry_attempts*] -# (Optional) Amount of times a client should be tried -# before it is marked dead and removed from the pool in -# the HashClient's internal mechanisms. -# Default to undef -# -# [*cache_hashclient_retry_delay*] -# (Optional) Time in seconds that should pass between -# retry attempts in the HashClient's internal mechanisms. -# Default to undef -# -# [*cache_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 -# -# [*manage_backend_package*] -# (Optional) If we should install the cache backend package. -# Defaults to undef -# # [*snmpd_readonly_username*] # (Optional) User name for snmpd authentication # Defaults to undef @@ -362,24 +264,6 @@ class ceilometer( $purge_config = false, $host = $::os_service_default, # DEPRECATED PARAMETERS - $cache_backend = undef, - $memcache_servers = undef, - $cache_enable_socket_keepalive = undef, - $cache_socket_keepalive_idle = undef, - $cache_socket_keepalive_interval = undef, - $cache_socket_keepalive_count = undef, - $cache_tls_enabled = undef, - $cache_tls_cafile = undef, - $cache_tls_certfile = undef, - $cache_tls_keyfile = undef, - $cache_tls_allowed_ciphers = undef, - $cache_enable_retry_client = undef, - $cache_retry_attempts = undef, - $cache_retry_delay = undef, - $cache_hashclient_retry_attempts = undef, - $cache_hashclient_retry_delay = undef, - $cache_dead_timeout = undef, - $manage_backend_package = undef, $snmpd_readonly_username = undef, $snmpd_readonly_user_password = undef, ) { @@ -387,32 +271,6 @@ class ceilometer( include ceilometer::deps include ceilometer::params - [ - 'cache_backend', - 'memcache_servers', - 'cache_enable_socket_keepalive', - 'cache_socket_keepalive_idle', - 'cache_socket_keepalive_interval', - 'cache_socket_keepalive_count', - 'cache_tls_enabled', - 'cache_tls_cafile', - 'cache_tls_certfile', - 'cache_tls_keyfile', - 'cache_tls_allowed_ciphers', - 'cache_enable_retry_client', - 'cache_retry_attempts', - 'cache_retry_delay', - 'cache_hashclient_retry_attempts', - 'cache_hashclient_retry_delay', - 'cache_dead_timeout', - 'manage_backend_package' - ].each |String $cache_opt| { - if getvar($cache_opt) != undef { - warning("The ceilometer::${cache_opt} parameter is deprecated. Use the ceilometer::cache class") - } - } - include ceilometer::cache - if $snmpd_readonly_username != undef or $snmpd_readonly_user_password != undef { warning('The snmpd_readonly_* parameters have been deprecated.') } diff --git a/releasenotes/notes/cleanup-cache-parameters-87dfad09ecabd187.yaml b/releasenotes/notes/cleanup-cache-parameters-87dfad09ecabd187.yaml new file mode 100644 index 0000000..de5d608 --- /dev/null +++ b/releasenotes/notes/cleanup-cache-parameters-87dfad09ecabd187.yaml @@ -0,0 +1,25 @@ +--- +upgrade: + - | + The following parameters of the ``ceilometer`` class have been removed. + Use the ``ceilometer::cache`` class and its parameters. + + - ``cache_backend`` + - ``memcache_servers`` + - ``cache_enable_socket_keepalive`` + - ``cache_socket_keepalive_idle`` + - ``cache_socket_keepalive_interval`` + - ``cache_socket_keepalive_count`` + - ``cache_tls_enabled`` + - ``cache_tls_cafile`` + - ``cache_tls_certfile`` + - ``cache_tls_keyfile`` + - ``cache_tls_allowed_ciphers`` + - ``cache_enable_retry_client`` + - ``cache_retry_attempts`` + - ``cache_retry_delay`` + - ``cache_hashclient_retry_attempts`` + - ``cache_hashclient_retry_delay`` + - ``cache_dead_timeout`` + - ``manage_backend_package`` + diff --git a/spec/classes/ceilometer_init_spec.rb b/spec/classes/ceilometer_init_spec.rb index 1ba0958..ee38242 100644 --- a/spec/classes/ceilometer_init_spec.rb +++ b/spec/classes/ceilometer_init_spec.rb @@ -105,29 +105,6 @@ describe 'ceilometer' do is_expected.to contain_ceilometer_config('hardware/readonly_user_password').with_value('').with_secret(true) end - it 'configures cache backend' do - is_expected.to contain_oslo__cache('ceilometer_config').with( - :backend => '', - :memcache_servers => '', - :enable_socket_keepalive => '', - :socket_keepalive_idle => '', - :socket_keepalive_interval => '', - :socket_keepalive_count => '', - :tls_enabled => '', - :tls_cafile => '', - :tls_certfile => '', - :tls_keyfile => '', - :tls_allowed_ciphers => '', - :enable_retry_client => '', - :retry_attempts => '', - :retry_delay => '', - :hashclient_retry_attempts => '', - :hashclient_retry_delay => '', - :dead_timeout => '', - :manage_backend_package => true, - ) - end - context 'with rabbitmq durable queues configured' do before { params.merge!( :amqp_durable_queues => true ) } it_configures 'rabbit with durable queues' @@ -153,46 +130,6 @@ describe 'ceilometer' do end end - context 'with overridden cache parameter' do - before { - params.merge!( - :cache_backend => 'memcache', - :memcache_servers => 'host1:11211,host2:11211', - :cache_enable_socket_keepalive => false, - :cache_socket_keepalive_idle => 1, - :cache_socket_keepalive_interval => 1, - :cache_socket_keepalive_count => 1, - :cache_tls_enabled => true, - :cache_enable_retry_client => false, - :cache_retry_attempts => 2, - :cache_retry_delay => 0, - :cache_hashclient_retry_attempts => 2, - :cache_hashclient_retry_delay => 1, - :cache_dead_timeout => 60, - :manage_backend_package => false, - ) - } - - it 'configures cache backend' do - is_expected.to contain_oslo__cache('ceilometer_config').with( - :backend => 'memcache', - :memcache_servers => 'host1:11211,host2:11211', - :enable_socket_keepalive => false, - :socket_keepalive_idle => 1, - :socket_keepalive_interval => 1, - :socket_keepalive_count => 1, - :tls_enabled => true, - :enable_retry_client => false, - :retry_attempts => 2, - :retry_delay => 0, - :hashclient_retry_attempts => 2, - :hashclient_retry_delay => 1, - :dead_timeout => 60, - :manage_backend_package => false, - ) - end - end - context 'with overridden notification parameters' do before { params.merge!( -- 2.45.2