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 # transport://user:pass@host1:port[,hostN:portN]/virtual_host
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*rpc_backend*]
# (optional) what rpc/queuing service to use
# Defaults to $::os_service_default
#
# [*rpc_response_timeout*] # [*rpc_response_timeout*]
# (optional) Seconds to wait for a response from a call # (optional) Seconds to wait for a response from a call
# Defaults to $::os_service_default # Defaults to $::os_service_default
@ -352,6 +348,10 @@
# multiple RabbitMQ Brokers. # multiple RabbitMQ Brokers.
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*rpc_backend*]
# (optional) what rpc/queuing service to use
# Defaults to $::os_service_default
#
class neutron ( class neutron (
$enabled = true, $enabled = true,
$package_ensure = 'present', $package_ensure = 'present',
@ -376,7 +376,6 @@ class neutron (
$report_interval = $::os_service_default, $report_interval = $::os_service_default,
$control_exchange = 'neutron', $control_exchange = 'neutron',
$default_transport_url = $::os_service_default, $default_transport_url = $::os_service_default,
$rpc_backend = $::os_service_default,
$rpc_response_timeout = $::os_service_default, $rpc_response_timeout = $::os_service_default,
$rabbit_ha_queues = $::os_service_default, $rabbit_ha_queues = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = $::os_service_default, $rabbit_heartbeat_timeout_threshold = $::os_service_default,
@ -430,6 +429,7 @@ class neutron (
$rabbit_port = $::os_service_default, $rabbit_port = $::os_service_default,
$rabbit_user = $::os_service_default, $rabbit_user = $::os_service_default,
$rabbit_virtual_host = $::os_service_default, $rabbit_virtual_host = $::os_service_default,
$rpc_backend = $::os_service_default,
) { ) {
include ::neutron::deps include ::neutron::deps
@ -467,10 +467,12 @@ class neutron (
!is_service_default($rabbit_password) or !is_service_default($rabbit_password) or
!is_service_default($rabbit_port) or !is_service_default($rabbit_port) or
!is_service_default($rabbit_user) 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, \ warning("neutron::rabbit_host, neutron::rabbit_hosts, neutron::rabbit_password, \
neutron::rabbit_port, neutron::rabbit_user and neutron::rabbit_virtual_host are \ neutron::rabbit_port, neutron::rabbit_user, neutron::rabbit_virtual_host and \
deprecated. Please use neutron::default_transport_url instead.") neutron::rpc_backend are deprecated. Please use neutron::default_transport_url \
instead.")
} }
package { 'neutron': package { 'neutron':
@ -526,56 +528,46 @@ deprecated. Please use neutron::default_transport_url instead.")
} }
} }
if $rpc_backend in [$::os_service_default, 'rabbit'] { oslo::messaging::rabbit {'neutron_config':
if is_service_default($default_transport_url) and is_service_default($rabbit_password) { rabbit_userid => $rabbit_user,
fail('When rpc_backend is rabbitmq, you must set rabbit password') 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': oslo::messaging::amqp { 'neutron_config':
rabbit_userid => $rabbit_user, server_request_prefix => $amqp_server_request_prefix,
rabbit_password => $rabbit_password, broadcast_prefix => $amqp_broadcast_prefix,
rabbit_virtual_host => $rabbit_virtual_host, group_request_prefix => $amqp_group_request_prefix,
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold, container_name => $amqp_container_name,
heartbeat_rate => $rabbit_heartbeat_rate, idle_timeout => $amqp_idle_timeout,
rabbit_use_ssl => $rabbit_use_ssl, trace => $amqp_trace,
rabbit_transient_queues_ttl => $rabbit_transient_queues_ttl, ssl_ca_file => $amqp_ssl_ca_file,
kombu_reconnect_delay => $kombu_reconnect_delay, ssl_cert_file => $amqp_ssl_cert_file,
kombu_missing_consumer_retry_timeout => $kombu_missing_consumer_retry_timeout, ssl_key_file => $amqp_ssl_key_file,
kombu_failover_strategy => $kombu_failover_strategy, ssl_key_password => $amqp_ssl_key_password,
kombu_compression => $kombu_compression, allow_insecure_clients => $amqp_allow_insecure_clients,
kombu_ssl_ca_certs => $kombu_ssl_ca_certs, sasl_mechanisms => $amqp_sasl_mechanisms,
kombu_ssl_certfile => $kombu_ssl_certfile, sasl_config_dir => $amqp_sasl_config_dir,
kombu_ssl_keyfile => $kombu_ssl_keyfile, sasl_config_name => $amqp_sasl_config_name,
amqp_durable_queues => $amqp_durable_queues, username => $amqp_username,
rabbit_hosts => $rabbit_hosts, password => $amqp_password,
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;
}
} }
# SSL Options # 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 transport_url defined'
it_configures 'with rootwrap daemon' it_configures 'with rootwrap daemon'
context 'with amqp rpc_backend value' do context 'with amqp messaging' do
it_configures 'amqp support' it_configures 'amqp support'
end end
end end
@ -472,9 +472,7 @@ describe 'neutron' do
end end
shared_examples_for 'amqp support' do shared_examples_for 'amqp support' do
context 'with default parameters' do context 'with default amqp parameters' do
before { params.merge!( :rpc_backend => 'amqp' ) }
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/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/broadcast_prefix').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_neutron_config('oslo_messaging_amqp/group_request_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 context 'with overriden amqp parameters' do
before { params.merge!( before { params.merge!(
:rpc_backend => 'amqp',
:amqp_idle_timeout => '60', :amqp_idle_timeout => '60',
:amqp_trace => true, :amqp_trace => true,
:amqp_ssl_ca_file => '/path/to/ca.cert', :amqp_ssl_ca_file => '/path/to/ca.cert',