Merge "Deprecate oslo.messaging rpc_backend option parameter"

This commit is contained in:
Jenkins 2017-07-27 20:16:52 +00:00 committed by Gerrit Code Review
commit a893c9876f
3 changed files with 50 additions and 58 deletions

View File

@ -18,10 +18,6 @@
# transport://user:pass@host1:port[,hostN:portN]/virtual_host
# Defaults to $::os_service_default
#
# [*rpc_backend*]
# (Optional) Use these options to configure the RabbitMQ message system.
# Defaults to 'rabbit'
#
# [*rpc_response_timeout*]
# (optional) Seconds to wait for a response from a call
# Defaults to $::os_service_default
@ -309,6 +305,10 @@
# not necessarily a host name, FQDN, or IP address.
# Defaults to $::os_service_default.
#
# [*rpc_backend*]
# (Optional) DEPRECATED. Use these options to configure the RabbitMQ message system.
# Defaults to 'rabbit'
#
class cinder (
$database_connection = undef,
$database_idle_timeout = undef,
@ -318,7 +318,6 @@ class cinder (
$database_retry_interval = undef,
$database_max_overflow = undef,
$default_transport_url = $::os_service_default,
$rpc_backend = 'rabbit',
$rpc_response_timeout = $::os_service_default,
$control_exchange = 'openstack',
$rabbit_ha_queues = $::os_service_default,
@ -379,6 +378,7 @@ class cinder (
$rabbit_userid = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
$host = $::os_service_default,
$rpc_backend = 'rabbit',
) inherits cinder::params {
include ::cinder::deps
@ -402,10 +402,12 @@ class cinder (
!is_service_default($rabbit_password) or
!is_service_default($rabbit_port) or
!is_service_default($rabbit_userid) or
!is_service_default($rpc_backend) or
!is_service_default($rabbit_virtual_host) {
warning("cinder::rabbit_host, cinder::rabbit_hosts, cinder::rabbit_password, \
cinder::rabbit_port, cinder::rabbit_userid and cinder::rabbit_virtual_host are \
deprecated. Please use cinder::default_transport_url instead.")
cinder::rabbit_port, cinder::rabbit_userid, cinder::rabbit_virtual_host and \
cinder::rpc_backend are deprecated. Please use cinder::default_transport_url \
instead.")
}
package { 'cinder':
@ -418,12 +420,6 @@ deprecated. Please use cinder::default_transport_url instead.")
purge => $purge_config,
}
if $rpc_backend == 'cinder.openstack.common.rpc.impl_kombu' or $rpc_backend == 'rabbit' {
if is_service_default($default_transport_url) and is_service_default($rabbit_password) {
fail('Please specify a rabbit_password parameter.')
}
oslo::messaging::rabbit { 'cinder_config':
rabbit_userid => $rabbit_userid,
rabbit_password => $rabbit_password,
@ -443,8 +439,6 @@ deprecated. Please use cinder::default_transport_url instead.")
amqp_durable_queues => $amqp_durable_queues,
kombu_compression => $kombu_compression,
}
}
elsif $rpc_backend == 'amqp' {
oslo::messaging::amqp { 'cinder_config':
server_request_prefix => $amqp_server_request_prefix,
@ -464,7 +458,6 @@ deprecated. Please use cinder::default_transport_url instead.")
username => $amqp_username,
password => $amqp_password,
}
}
oslo::messaging::default { 'cinder_config':
transport_url => $default_transport_url,

View File

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

View File

@ -180,11 +180,7 @@ describe 'cinder' do
it { is_expected.to contain_cinder_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(true) }
end
describe 'with amqp rpc_backend defaults' do
let :params do
{ :rpc_backend => 'amqp' }
end
describe 'with amqp defaults' do
it 'configures amqp' do
is_expected.to contain_cinder_config('oslo_messaging_amqp/server_request_prefix').with_value('<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('oslo_messaging_amqp/broadcast_prefix').with_value('<SERVICE DEFAULT>')
@ -205,10 +201,9 @@ describe 'cinder' do
end
end
describe 'with amqp rpc_backend overrides' do
describe 'with amqp overrides' do
let :params do
{
:rpc_backend => 'amqp',
:amqp_idle_timeout => '60',
:amqp_trace => true,
:amqp_ssl_ca_file => '/path/to/ca.cert',