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: Icc6fa09cdd5ea20b8126aab577cf9ff9a33d93f7
Closes-Bug: #1708976
This commit is contained in:
ZhongShengping
2017-08-07 14:18:27 +08:00
parent 0e05ef32b6
commit a16691710b
3 changed files with 65 additions and 69 deletions

View File

@@ -24,13 +24,6 @@
# option.
# Defaults to $::os_service_default
#
# [*rpc_backend*]
# (optional) The rpc backend implementation to use, can be:
# amqp (for AMQP 1.0 protocol)
# rabbit (for rabbitmq)
# zmq (for zeromq)
# Defaults to 'rabbit'
#
# [*rabbit_use_ssl*]
# (optional) Connect over SSL for RabbitMQ
# Defaults to $::os_service_default
@@ -181,12 +174,18 @@
# (optional) The state of aodh packages
# Defaults to undef
#
# [*rpc_backend*]
# (optional) The rpc backend implementation to use, can be:
# amqp (for AMQP 1.0 protocol)
# rabbit (for rabbitmq)
# zmq (for zeromq)
# Defaults to 'rabbit'
#
class octavia (
$package_ensure = 'present',
$default_transport_url = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$control_exchange = $::os_service_default,
$rpc_backend = 'rabbit',
$rabbit_use_ssl = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = $::os_service_default,
$rabbit_heartbeat_rate = $::os_service_default,
@@ -221,6 +220,7 @@ class octavia (
$purge_config = false,
# DEPRECATED PARAMETERS
$ensure_package = undef,
$rpc_backend = 'rabbit',
) inherits octavia::params {
include ::octavia::deps
@@ -234,6 +234,10 @@ the future release. Please use octavia::package_ensure instead.")
$package_ensure_real = $package_ensure
}
if $rpc_backend {
warning('The rpc_backend parameter has been deprecated, please use default_transport_url instead.')
}
package { 'octavia':
ensure => $package_ensure_real,
name => $::octavia::params::common_package_name,
@@ -244,7 +248,6 @@ the future release. Please use octavia::package_ensure instead.")
purge => $purge_config,
}
if $rpc_backend == 'rabbit' {
oslo::messaging::rabbit { 'octavia_config':
rabbit_ha_queues => $rabbit_ha_queues,
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
@@ -258,8 +261,7 @@ the future release. Please use octavia::package_ensure instead.")
kombu_compression => $kombu_compression,
amqp_durable_queues => $amqp_durable_queues,
}
}
elsif $rpc_backend == 'amqp' {
oslo::messaging::amqp { 'octavia_config':
server_request_prefix => $amqp_server_request_prefix,
broadcast_prefix => $amqp_broadcast_prefix,
@@ -278,7 +280,6 @@ the future release. Please use octavia::package_ensure instead.")
username => $amqp_username,
password => $amqp_password,
}
}
oslo::messaging::default { 'octavia_config':
transport_url => $default_transport_url,

View File

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

View File

@@ -32,7 +32,6 @@ describe 'octavia' do
end
it 'configures rabbit' do
is_expected.to contain_octavia_config('DEFAULT/rpc_backend').with_value('rabbit')
is_expected.to contain_octavia_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>')
@@ -67,7 +66,6 @@ describe 'octavia' do
end
it 'configures rabbit' do
is_expected.to contain_octavia_config('DEFAULT/rpc_backend').with_value('rabbit')
is_expected.to contain_octavia_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_octavia_config('DEFAULT/rpc_response_timeout').with_value('120')
is_expected.to contain_octavia_config('DEFAULT/control_exchange').with_value('octavia')
@@ -170,12 +168,7 @@ describe 'octavia' do
end
end
context 'with amqp rpc_backend' do
let :params do
{ :rpc_backend => 'amqp' }
end
context 'with default parameters' do
context 'with amqp default parameters' do
it 'configures amqp' do
is_expected.to contain_octavia_config('oslo_messaging_amqp/server_request_prefix').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('oslo_messaging_amqp/broadcast_prefix').with_value('<SERVICE DEFAULT>')
@@ -195,12 +188,10 @@ describe 'octavia' do
is_expected.to contain_octavia_config('oslo_messaging_amqp/password').with_value('<SERVICE DEFAULT>')
end
end
end
context 'with overriden amqp parameters' do
let :params do
{ :rpc_backend => 'amqp',
:default_transport_url => 'amqp://amqp_user:password@localhost:5672',
{ :default_transport_url => 'amqp://amqp_user:password@localhost:5672',
:amqp_idle_timeout => '60',
:amqp_trace => true,
:amqp_ssl_ca_file => '/etc/ca.cert',