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: I0c9bacd06490dfd5810e528f8dd0b630d33954c8 Closes-Bug: #1708976
This commit is contained in:
parent
ad95dd8094
commit
df39ae39bc
@ -28,11 +28,6 @@
|
||||
# (required) Version of Nova API to use in novaclient.
|
||||
# Default is 2.
|
||||
#
|
||||
# [*rpc_backend*]
|
||||
# (optional) The messaging driver to use, defaults to rabbit. Other drivers
|
||||
# include amqp and zmq.
|
||||
# Defaults to 'rabbit'.
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# (optional) Whether the watcher api package will be installed
|
||||
# Defaults to 'present'
|
||||
@ -306,6 +301,11 @@
|
||||
# (Optional) Maximum number of RabbitMQ connection retries. (integer value)
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*rpc_backend*]
|
||||
# (optional) The messaging driver to use, defaults to rabbit. Other drivers
|
||||
# include amqp and zmq.
|
||||
# Defaults to 'rabbit'.
|
||||
#
|
||||
# === Authors
|
||||
#
|
||||
# Daniel Pawlik <daniel.pawlik@corp.ovh.com>
|
||||
@ -318,7 +318,6 @@ class watcher (
|
||||
$glance_client_api_version = '2',
|
||||
$neutron_client_api_version = '2',
|
||||
$nova_client_api_version = '2',
|
||||
$rpc_backend = 'rabbit',
|
||||
$package_ensure = 'present',
|
||||
$rabbit_login_method = $::os_service_default,
|
||||
$rabbit_retry_interval = $::os_service_default,
|
||||
@ -380,6 +379,7 @@ class watcher (
|
||||
# DEPRECATED PARAMETERS
|
||||
$ensure_package = undef,
|
||||
$rabbit_max_retries = undef,
|
||||
$rpc_backend = 'rabbit',
|
||||
) {
|
||||
|
||||
include ::openstacklib::openstackclient
|
||||
@ -402,6 +402,10 @@ the future release. Please use watcher::package_ensure instead.")
|
||||
warning('The rabbit_max_retries parameter has been deprecated and will be removed in the future release.')
|
||||
}
|
||||
|
||||
if $rpc_backend {
|
||||
warning('The rpc_backend parameter has been deprecated, please use default_transport_url instead.')
|
||||
}
|
||||
|
||||
package { 'watcher':
|
||||
ensure => $package_ensure_real,
|
||||
name => $::watcher::params::common_package_name,
|
||||
@ -420,70 +424,61 @@ the future release. Please use watcher::package_ensure instead.")
|
||||
'nova_client/api_version': value => $nova_client_api_version;
|
||||
}
|
||||
|
||||
if $rpc_backend == 'rabbit' {
|
||||
oslo::messaging::rabbit { 'watcher_config':
|
||||
amqp_durable_queues => $amqp_durable_queues,
|
||||
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,
|
||||
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,
|
||||
rabbit_use_ssl => $rabbit_use_ssl,
|
||||
rabbit_login_method => $rabbit_login_method,
|
||||
rabbit_retry_interval => $rabbit_retry_interval,
|
||||
rabbit_retry_backoff => $rabbit_retry_backoff,
|
||||
rabbit_interval_max => $rabbit_interval_max,
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
rabbit_transient_queues_ttl => $rabbit_transient_queues_ttl,
|
||||
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
|
||||
heartbeat_rate => $rabbit_heartbeat_rate,
|
||||
}
|
||||
|
||||
oslo::messaging::rabbit { 'watcher_config':
|
||||
amqp_durable_queues => $amqp_durable_queues,
|
||||
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,
|
||||
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,
|
||||
rabbit_use_ssl => $rabbit_use_ssl,
|
||||
rabbit_login_method => $rabbit_login_method,
|
||||
rabbit_retry_interval => $rabbit_retry_interval,
|
||||
rabbit_retry_backoff => $rabbit_retry_backoff,
|
||||
rabbit_interval_max => $rabbit_interval_max,
|
||||
rabbit_ha_queues => $rabbit_ha_queues,
|
||||
rabbit_transient_queues_ttl => $rabbit_transient_queues_ttl,
|
||||
heartbeat_timeout_threshold => $rabbit_heartbeat_timeout_threshold,
|
||||
heartbeat_rate => $rabbit_heartbeat_rate,
|
||||
}
|
||||
} elsif $rpc_backend == 'amqp' {
|
||||
oslo::messaging::amqp { 'watcher_config':
|
||||
username => $amqp_username,
|
||||
password => $amqp_password,
|
||||
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,
|
||||
}
|
||||
|
||||
if is_service_default($default_transport_url) and is_service_default($amqp_password) {
|
||||
fail('Please specify a amqp_password parameter.')
|
||||
}
|
||||
oslo::messaging::amqp { 'watcher_config':
|
||||
username => $amqp_username,
|
||||
password => $amqp_password,
|
||||
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,
|
||||
}
|
||||
} elsif $rpc_backend == 'zmq' {
|
||||
oslo::messaging::zmq { 'watcher_config':
|
||||
rpc_cast_timeout => $rpc_cast_timeout,
|
||||
rpc_poll_timeout => $rpc_poll_timeout,
|
||||
rpc_zmq_bind_address => $rpc_zmq_bind_address,
|
||||
rpc_zmq_bind_port_retries => $rpc_zmq_bind_port_retries,
|
||||
rpc_zmq_concurrency => $rpc_zmq_concurrency,
|
||||
rpc_zmq_contexts => $rpc_zmq_contexts,
|
||||
rpc_zmq_host => $rpc_zmq_host,
|
||||
rpc_zmq_ipc_dir => $rpc_zmq_ipc_dir,
|
||||
rpc_zmq_matchmaker => $rpc_zmq_matchmaker,
|
||||
rpc_zmq_max_port => $rpc_zmq_max_port,
|
||||
rpc_zmq_min_port => $rpc_zmq_min_port,
|
||||
rpc_zmq_topic_backlog => $rpc_zmq_topic_backlog,
|
||||
use_pub_sub => $use_pub_sub,
|
||||
zmq_target_expire => $zmq_target_expire,
|
||||
}
|
||||
} else {
|
||||
watcher_config { 'DEFAULT/rpc_backend': value => $rpc_backend }
|
||||
oslo::messaging::zmq { 'watcher_config':
|
||||
rpc_cast_timeout => $rpc_cast_timeout,
|
||||
rpc_poll_timeout => $rpc_poll_timeout,
|
||||
rpc_zmq_bind_address => $rpc_zmq_bind_address,
|
||||
rpc_zmq_bind_port_retries => $rpc_zmq_bind_port_retries,
|
||||
rpc_zmq_concurrency => $rpc_zmq_concurrency,
|
||||
rpc_zmq_contexts => $rpc_zmq_contexts,
|
||||
rpc_zmq_host => $rpc_zmq_host,
|
||||
rpc_zmq_ipc_dir => $rpc_zmq_ipc_dir,
|
||||
rpc_zmq_matchmaker => $rpc_zmq_matchmaker,
|
||||
rpc_zmq_max_port => $rpc_zmq_max_port,
|
||||
rpc_zmq_min_port => $rpc_zmq_min_port,
|
||||
rpc_zmq_topic_backlog => $rpc_zmq_topic_backlog,
|
||||
use_pub_sub => $use_pub_sub,
|
||||
zmq_target_expire => $zmq_target_expire,
|
||||
}
|
||||
|
||||
oslo::messaging::default { 'watcher_config':
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
deprecations:
|
||||
- watcher::rpc_backend is deprecated and will be removed in a future
|
||||
release. Please use watcher::default_transport_url instead.
|
@ -29,7 +29,6 @@ describe 'watcher' do
|
||||
it { is_expected.to contain_class('watcher::deps') }
|
||||
|
||||
it 'configures rabbit' do
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_backend').with_value('rabbit')
|
||||
is_expected.to contain_watcher_config('oslo_messaging_rabbit/rabbit_login_method').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('oslo_messaging_rabbit/rabbit_retry_interval').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('oslo_messaging_rabbit/rabbit_retry_backoff').with_value('<SERVICE DEFAULT>')
|
||||
@ -68,7 +67,6 @@ describe 'watcher' do
|
||||
}
|
||||
end
|
||||
it 'configures rabbit' do
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_backend').with_value('rabbit')
|
||||
is_expected.to contain_watcher_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
|
||||
is_expected.to contain_watcher_config('oslo_messaging_rabbit/heartbeat_timeout_threshold').with_value('60')
|
||||
is_expected.to contain_watcher_config('oslo_messaging_rabbit/heartbeat_rate').with_value('10')
|
||||
@ -167,10 +165,9 @@ describe 'watcher' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'with amqp rpc_backend' do
|
||||
context 'with amqp overrides' 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', }
|
||||
end
|
||||
|
||||
context 'with default parameters' do
|
||||
@ -198,8 +195,7 @@ describe 'watcher' do
|
||||
|
||||
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',
|
||||
@ -222,35 +218,28 @@ describe 'watcher' do
|
||||
end
|
||||
end
|
||||
|
||||
context 'with zmq rpc_backend' do
|
||||
let :params do
|
||||
{ :rpc_backend => 'zmq' }
|
||||
end
|
||||
|
||||
context 'with default parameters' do
|
||||
it 'configures zmq' do
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_cast_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_poll_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_bind_address').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_bind_port_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_concurrency').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_contexts').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_host').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_ipc_dir').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_matchmaker').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_max_port').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_min_port').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_topic_backlog').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/use_pub_sub').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/zmq_target_expire').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
context 'with zmq default parameters' do
|
||||
it 'configures zmq' do
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_cast_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_poll_timeout').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_bind_address').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_bind_port_retries').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_concurrency').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_contexts').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_host').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_ipc_dir').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_matchmaker').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_max_port').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_min_port').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/rpc_zmq_topic_backlog').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/use_pub_sub').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_watcher_config('DEFAULT/zmq_target_expire').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with overriden zmq parameters' do
|
||||
let :params do
|
||||
{ :rpc_backend => 'zmq',
|
||||
:default_transport_url => 'zmq://zmq_user:password@localhost:5555',
|
||||
{ :default_transport_url => 'zmq://zmq_user:password@localhost:5555',
|
||||
:rpc_zmq_min_port => '49200',
|
||||
:rpc_zmq_max_port => '65000',
|
||||
:rpc_zmq_bind_port_retries => '120',
|
||||
|
Loading…
Reference in New Issue
Block a user