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: I071912e15a2e98f523b0888f9f4f20b9ed94e4d9
This commit is contained in:
Andrew Smith 2017-07-26 16:20:48 -04:00
parent 63a0004592
commit 4b5ff430a6
3 changed files with 55 additions and 62 deletions

View File

@ -116,10 +116,6 @@
# transport://user:pass@host1:port[,hostN:portN]/virtual_host
# Defaults to $::os_service_default
#
# [*rpc_backend*]
# (optional) what rpc/queuing service to use
# Defaults to $::os_service_default
#
# [*rpc_response_timeout*]
# (optional) Seconds to wait for a response from a call
# Defaults to $::os_service_default
@ -352,6 +348,10 @@
# multiple RabbitMQ Brokers.
# Defaults to $::os_service_default
#
# [*rpc_backend*]
# (optional) what rpc/queuing service to use
# Defaults to $::os_service_default
#
class neutron (
$enabled = true,
$package_ensure = 'present',
@ -376,7 +376,6 @@ class neutron (
$report_interval = $::os_service_default,
$control_exchange = 'neutron',
$default_transport_url = $::os_service_default,
$rpc_backend = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$rabbit_ha_queues = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = $::os_service_default,
@ -430,6 +429,7 @@ class neutron (
$rabbit_port = $::os_service_default,
$rabbit_user = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
$rpc_backend = $::os_service_default,
) {
include ::neutron::deps
@ -467,10 +467,12 @@ class neutron (
!is_service_default($rabbit_password) or
!is_service_default($rabbit_port) or
!is_service_default($rabbit_user) or
!is_service_default($rabbit_virtual_host) {
!is_service_default($rabbit_virtual_host) or
!is_service_default($rpc_backend) {
warning("neutron::rabbit_host, neutron::rabbit_hosts, neutron::rabbit_password, \
neutron::rabbit_port, neutron::rabbit_user and neutron::rabbit_virtual_host are \
deprecated. Please use neutron::default_transport_url instead.")
neutron::rabbit_port, neutron::rabbit_user, neutron::rabbit_virtual_host and \
neutron::rpc_backend are deprecated. Please use neutron::default_transport_url \
instead.")
}
package { 'neutron':
@ -526,56 +528,46 @@ deprecated. Please use neutron::default_transport_url instead.")
}
}
if $rpc_backend in [$::os_service_default, 'rabbit'] {
if is_service_default($default_transport_url) and is_service_default($rabbit_password) {
fail('When rpc_backend is rabbitmq, you must set rabbit password')
}
oslo::messaging::rabbit {'neutron_config':
rabbit_userid => $rabbit_user,
rabbit_password => $rabbit_password,
rabbit_virtual_host => $rabbit_virtual_host,
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
heartbeat_rate => $rabbit_heartbeat_rate,
rabbit_use_ssl => $rabbit_use_ssl,
rabbit_transient_queues_ttl => $rabbit_transient_queues_ttl,
kombu_reconnect_delay => $kombu_reconnect_delay,
kombu_missing_consumer_retry_timeout => $kombu_missing_consumer_retry_timeout,
kombu_failover_strategy => $kombu_failover_strategy,
kombu_compression => $kombu_compression,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
kombu_ssl_certfile => $kombu_ssl_certfile,
kombu_ssl_keyfile => $kombu_ssl_keyfile,
amqp_durable_queues => $amqp_durable_queues,
rabbit_hosts => $rabbit_hosts,
rabbit_ha_queues => $rabbit_ha_queues,
rabbit_host => $rabbit_host,
rabbit_port => $rabbit_port,
kombu_ssl_version => $kombu_ssl_version,
}
oslo::messaging::rabbit {'neutron_config':
rabbit_userid => $rabbit_user,
rabbit_password => $rabbit_password,
rabbit_virtual_host => $rabbit_virtual_host,
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
heartbeat_rate => $rabbit_heartbeat_rate,
rabbit_use_ssl => $rabbit_use_ssl,
rabbit_transient_queues_ttl => $rabbit_transient_queues_ttl,
kombu_reconnect_delay => $kombu_reconnect_delay,
kombu_missing_consumer_retry_timeout => $kombu_missing_consumer_retry_timeout,
kombu_failover_strategy => $kombu_failover_strategy,
kombu_compression => $kombu_compression,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs,
kombu_ssl_certfile => $kombu_ssl_certfile,
kombu_ssl_keyfile => $kombu_ssl_keyfile,
amqp_durable_queues => $amqp_durable_queues,
rabbit_hosts => $rabbit_hosts,
rabbit_ha_queues => $rabbit_ha_queues,
rabbit_host => $rabbit_host,
rabbit_port => $rabbit_port,
kombu_ssl_version => $kombu_ssl_version,
}
} elsif $rpc_backend == 'amqp' {
oslo::messaging::amqp { 'neutron_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,
}
} else {
neutron_config {
'DEFAULT/rpc_backend': value => $rpc_backend;
}
oslo::messaging::amqp { 'neutron_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,
}
# SSL Options

View File

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

View File

@ -92,7 +92,7 @@ describe 'neutron' do
it_configures 'with transport_url defined'
it_configures 'with rootwrap daemon'
context 'with amqp rpc_backend value' do
context 'with amqp messaging' do
it_configures 'amqp support'
end
end
@ -472,9 +472,7 @@ describe 'neutron' do
end
shared_examples_for 'amqp support' do
context 'with default parameters' do
before { params.merge!( :rpc_backend => 'amqp' ) }
context 'with default amqp parameters' do
it { is_expected.to contain_neutron_config('oslo_messaging_amqp/server_request_prefix').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_neutron_config('oslo_messaging_amqp/broadcast_prefix').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_neutron_config('oslo_messaging_amqp/group_request_prefix').with_value('<SERVICE DEFAULT>') }
@ -495,7 +493,6 @@ describe 'neutron' 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',