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,52 +420,43 @@ 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,
rabbit_virtual_host => $rabbit_virtual_host,
rabbit_host => $rabbit_host,
rabbit_port => $rabbit_port,
rabbit_hosts => $rabbit_hosts,
rabbit_ha_queues => $rabbit_ha_queues,
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
heartbeat_rate => $rabbit_heartbeat_rate,
rabbit_use_ssl => $rabbit_use_ssl,
kombu_reconnect_delay => $kombu_reconnect_delay,
kombu_ssl_version => $kombu_ssl_version,
kombu_ssl_keyfile => $kombu_ssl_keyfile,
kombu_ssl_certfile => $kombu_ssl_certfile,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
amqp_durable_queues => $amqp_durable_queues,
kombu_compression => $kombu_compression,
}
oslo::messaging::rabbit { 'cinder_config':
rabbit_userid => $rabbit_userid,
rabbit_password => $rabbit_password,
rabbit_virtual_host => $rabbit_virtual_host,
rabbit_host => $rabbit_host,
rabbit_port => $rabbit_port,
rabbit_hosts => $rabbit_hosts,
rabbit_ha_queues => $rabbit_ha_queues,
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
heartbeat_rate => $rabbit_heartbeat_rate,
rabbit_use_ssl => $rabbit_use_ssl,
kombu_reconnect_delay => $kombu_reconnect_delay,
kombu_ssl_version => $kombu_ssl_version,
kombu_ssl_keyfile => $kombu_ssl_keyfile,
kombu_ssl_certfile => $kombu_ssl_certfile,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
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,
broadcast_prefix => $amqp_broadcast_prefix,
group_request_prefix => $amqp_group_request_prefix,
container_name => $amqp_container_name,
idle_timeout => $amqp_idle_timeout,
trace => $amqp_trace,
ssl_ca_file => $amqp_ssl_ca_file,
ssl_cert_file => $amqp_ssl_cert_file,
ssl_key_file => $amqp_ssl_key_file,
ssl_key_password => $amqp_ssl_key_password,
allow_insecure_clients => $amqp_allow_insecure_clients,
sasl_mechanisms => $amqp_sasl_mechanisms,
sasl_config_dir => $amqp_sasl_config_dir,
sasl_config_name => $amqp_sasl_config_name,
username => $amqp_username,
password => $amqp_password,
}
oslo::messaging::amqp { 'cinder_config':
server_request_prefix => $amqp_server_request_prefix,
broadcast_prefix => $amqp_broadcast_prefix,
group_request_prefix => $amqp_group_request_prefix,
container_name => $amqp_container_name,
idle_timeout => $amqp_idle_timeout,
trace => $amqp_trace,
ssl_ca_file => $amqp_ssl_ca_file,
ssl_cert_file => $amqp_ssl_cert_file,
ssl_key_file => $amqp_ssl_key_file,
ssl_key_password => $amqp_ssl_key_password,
allow_insecure_clients => $amqp_allow_insecure_clients,
sasl_mechanisms => $amqp_sasl_mechanisms,
sasl_config_dir => $amqp_sasl_config_dir,
sasl_config_name => $amqp_sasl_config_name,
username => $amqp_username,
password => $amqp_password,
}
oslo::messaging::default { 'cinder_config':

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',