Browse Source

Deprecate memcached_servers parameter

It is 'memcache_servers' in group [cache], not 'memcached_servers'.
For better understanding, deprecate memcached_servers option and
use memcahce_servers instead.

Change-Id: I57d7b45438904387176200c0062b7f33f4268006
Closes-Bug: #1690981
changes/19/464919/4
ZhongShengping 5 years ago committed by Alex Schultz
parent
commit
f7d5a712dc
  1. 20
      manifests/init.pp
  2. 4
      releasenotes/notes/deprecate_memcached_servers-819a35d8991621f7.yaml
  3. 42
      spec/classes/ceilometer_init_spec.rb

20
manifests/init.pp

@ -138,7 +138,7 @@
# (string value)
# Defaults to $::os_service_default
#
# [*memcached_servers*]
# [*memcache_servers*]
# (Optional) A list of memcached server(s) to use for caching. (list value)
# Defaults to $::os_service_default
#
@ -253,6 +253,10 @@
# (Optional) The RabbitMQ virtual host. (string value)
# Defaults to $::os_service_default
#
# [*memcached_servers*]
# (Optional) A list of memcached server(s) to use for caching. (list value)
# Defaults to $::os_service_default
#
class ceilometer(
$http_timeout = '600',
$event_time_to_live = '-1',
@ -282,7 +286,7 @@ class ceilometer(
$kombu_ssl_version = $::os_service_default,
$kombu_reconnect_delay = $::os_service_default,
$kombu_compression = $::os_service_default,
$memcached_servers = $::os_service_default,
$memcache_servers = $::os_service_default,
$amqp_server_request_prefix = $::os_service_default,
$amqp_broadcast_prefix = $::os_service_default,
$amqp_group_request_prefix = $::os_service_default,
@ -311,6 +315,7 @@ class ceilometer(
$rabbit_userid = $::os_service_default,
$rabbit_password = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
$memcached_servers = undef,
) {
include ::ceilometer::deps
@ -346,6 +351,15 @@ ceilometer::rabbit_port, ceilometer::rabbit_userid and ceilometer::rabbit_virtua
deprecated. Please use ceilometer::default_transport_url instead.")
}
if $memcached_servers {
warning("memcached_servers parameter is deprecated and will be removed in the future release, \
please use memcache_servers instead.")
$memcache_servers_real = $memcached_servers
}
else {
$memcache_servers_real = $memcache_servers
}
group { 'ceilometer':
name => 'ceilometer',
require => Anchor['ceilometer::install::end'],
@ -435,6 +449,6 @@ deprecated. Please use ceilometer::default_transport_url instead.")
}
oslo::cache { 'ceilometer_config':
memcache_servers => $memcached_servers,
memcache_servers => $memcache_servers_real,
}
}

4
releasenotes/notes/deprecate_memcached_servers-819a35d8991621f7.yaml

@ -0,0 +1,4 @@
---
deprecations:
- memcached_servers option is now deprecated and will be removed in
the future release, please use memcache_servers instead.

42
spec/classes/ceilometer_init_spec.rb

@ -4,24 +4,24 @@ describe 'ceilometer' do
let :params do
{
:http_timeout => '600',
:event_time_to_live => '604800',
:metering_time_to_live => '604800',
:telemetry_secret => 'metering-s3cr3t',
:package_ensure => 'present',
:debug => 'False',
:log_dir => '/var/log/ceilometer',
:use_stderr => 'True',
:purge_config => false,
:http_timeout => '600',
:event_time_to_live => '604800',
:metering_time_to_live => '604800',
:telemetry_secret => 'metering-s3cr3t',
:package_ensure => 'present',
:debug => 'False',
:log_dir => '/var/log/ceilometer',
:use_stderr => 'True',
:purge_config => false,
}
end
let :rabbit_params do
{
:rabbit_host => '127.0.0.1',
:rabbit_port => 5672,
:rabbit_userid => 'guest',
:rabbit_password => '',
:rabbit_host => '127.0.0.1',
:rabbit_port => 5672,
:rabbit_userid => 'guest',
:rabbit_password => '',
}
end
@ -139,6 +139,10 @@ describe 'ceilometer' do
is_expected.to contain_ceilometer_config('hardware/readonly_user_password').with_value('<SERVICE DEFAULT>')
end
it 'configures cache backend' do
is_expected.to contain_ceilometer_config('cache/memcache_servers').with_value('<SERVICE DEFAULT>')
end
context 'with rabbitmq durable queues configured' do
before { params.merge!( :amqp_durable_queues => true ) }
it_configures 'rabbit with durable queues'
@ -160,6 +164,18 @@ describe 'ceilometer' do
end
end
context 'with overriden cache parameter' do
before {
params.merge!(
:memcache_servers => 'host1:11211,host2:11211',
)
}
it 'configures cache backend' do
is_expected.to contain_ceilometer_config('cache/memcache_servers').with_value('host1:11211,host2:11211')
end
end
context 'with overriden notification parameters' do
before {
params.merge!(

Loading…
Cancel
Save