Deprecate oslo.messaging rpc_backend option parameter

Oslo.messaging uses the transport_url to represent the rpc and
notification messaging driver to use and its full configuration. The
rpc_backend configuration option is deprecated for removal and
should not gate oslo.messaging driver configuration options.

This patch:
* deprecate rpc_backend
* remove conditional check
* update spec tests
* add release note

Change-Id: Ib58f85348920459f6ae0445379ddcb50185b8518
This commit is contained in:
Andrew Smith 2017-07-26 20:50:00 -04:00
parent ff39854f4f
commit 138c320c89
3 changed files with 56 additions and 56 deletions

View File

@ -78,11 +78,6 @@
# transport://user:pass@host1:port[,hostN:portN]/virtual_host
# Defaults to $::os_service_default
#
# [*rpc_backend*]
# (optional) The messaging driver to use, defaults to rabbit. Other drivers include
# amqp and zmq. (string value)
# Default to $::os_service_default
#
# [*rabbit_ha_queues*]
# (Optional) Use HA queues in RabbitMQ (x-ha-policy: all). If you change this
# option, you must wipe the RabbitMQ database. (boolean value)
@ -260,6 +255,12 @@
# (Optional) A list of memcached server(s) to use for caching. (list value)
# Defaults to $::os_service_default
#
# [*rpc_backend*]
# (optional) The messaging driver to use, defaults to rabbit. Other drivers include
# amqp and zmq. (string value)
# Default to $::os_service_default
#
class ceilometer(
$http_timeout = '600',
$event_time_to_live = '-1',
@ -277,7 +278,6 @@ class ceilometer(
$rpc_response_timeout = $::os_service_default,
$control_exchange = $::os_service_default,
$notification_transport_url = $::os_service_default,
$rpc_backend = $::os_service_default,
$rabbit_ha_queues = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = $::os_service_default,
$rabbit_heartbeat_rate = $::os_service_default,
@ -320,6 +320,7 @@ class ceilometer(
$rabbit_password = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
$memcached_servers = undef,
$rpc_backend = $::os_service_default,
) {
include ::ceilometer::deps
@ -349,10 +350,12 @@ class ceilometer(
!is_service_default($rabbit_password) or
!is_service_default($rabbit_port) or
!is_service_default($rabbit_userid) or
!is_service_default($rabbit_virtual_host) {
!is_service_default($rabbit_virtual_host) or
!is_service_default($rpc_backend) {
warning("ceilometer::rabbit_host, ceilometer::rabbit_hosts, ceilometer::rabbit_password, \
ceilometer::rabbit_port, ceilometer::rabbit_userid and ceilometer::rabbit_virtual_host are \
deprecated. Please use ceilometer::default_transport_url instead.")
ceilometer::rabbit_port, ceilometer::rabbit_userid, ceilometer::rabbit_virtual_host and \
ceilometer::rpc_backend are deprecated. Please use ceilometer::default_transport_url \
instead.")
}
if $memcached_servers {
@ -388,8 +391,7 @@ please use memcache_servers instead.")
purge => $purge_config,
}
# we keep "ceilometer.openstack.common.rpc.impl_kombu" for backward compatibility
if $rpc_backend in [$::os_service_default, 'ceilometer.openstack.common.rpc.impl_kombu', 'rabbit'] {
oslo::messaging::rabbit {'ceilometer_config':
rabbit_host => $rabbit_host,
rabbit_port => $rabbit_port,
@ -410,7 +412,7 @@ please use memcache_servers instead.")
kombu_reconnect_delay => $kombu_reconnect_delay,
kombu_compression => $kombu_compression,
}
} elsif $rpc_backend == 'amqp' {
oslo::messaging::amqp { 'ceilometer_config':
server_request_prefix => $amqp_server_request_prefix,
broadcast_prefix => $amqp_broadcast_prefix,
@ -429,9 +431,6 @@ please use memcache_servers instead.")
username => $amqp_username,
password => $amqp_password,
}
} else {
nova_config { 'DEFAULT/rpc_backend': value => $rpc_backend }
}
# Once we got here, we can act as an honey badger on the rpc used.
ceilometer_config {

View File

@ -0,0 +1,4 @@
---
deprecations:
- ceilometer::rpc_backend is deprecated and will be removed in a future
release. Please use ceilometer::default_transport_url instead.

View File

@ -72,7 +72,7 @@ describe 'ceilometer' do
end
end
context 'with amqp rpc_backend value' do
context 'with amqp messaging' do
it_configures 'amqp support'
end
@ -365,8 +365,6 @@ describe 'ceilometer' do
shared_examples_for 'amqp support' do
context 'with default parameters' do
before { params.merge!( :rpc_backend => 'amqp' ) }
it { is_expected.to contain_ceilometer_config('oslo_messaging_amqp/server_request_prefix').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_amqp/broadcast_prefix').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_ceilometer_config('oslo_messaging_amqp/group_request_prefix').with_value('<SERVICE DEFAULT>') }
@ -387,7 +385,6 @@ describe 'ceilometer' do
context 'with overriden amqp parameters' do
before { params.merge!(
:rpc_backend => 'amqp',
:amqp_idle_timeout => '60',
:amqp_trace => true,
:amqp_ssl_ca_file => '/path/to/ca.cert',