From 8b9d969b8d7270069cd0f45dca7d43b7fc8ea23b Mon Sep 17 00:00:00 2001 From: Andrew Smith Date: Wed, 26 Jul 2017 15:45:14 -0400 Subject: [PATCH] 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: I2d0194846fe2549f573ad94196a8bbb54e3e4296 --- manifests/init.pp | 95 +++++++++---------- ...pc_backend_parameter-a192bd1166eb4ff2.yaml | 4 + spec/classes/cinder_init_spec.rb | 9 +- 3 files changed, 50 insertions(+), 58 deletions(-) create mode 100644 releasenotes/notes/deprecate_rpc_backend_parameter-a192bd1166eb4ff2.yaml diff --git a/manifests/init.pp b/manifests/init.pp index fd4573eb..bf84f81a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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': diff --git a/releasenotes/notes/deprecate_rpc_backend_parameter-a192bd1166eb4ff2.yaml b/releasenotes/notes/deprecate_rpc_backend_parameter-a192bd1166eb4ff2.yaml new file mode 100644 index 00000000..18924883 --- /dev/null +++ b/releasenotes/notes/deprecate_rpc_backend_parameter-a192bd1166eb4ff2.yaml @@ -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. diff --git a/spec/classes/cinder_init_spec.rb b/spec/classes/cinder_init_spec.rb index 88a48e28..fd4b9161 100644 --- a/spec/classes/cinder_init_spec.rb +++ b/spec/classes/cinder_init_spec.rb @@ -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('') is_expected.to contain_cinder_config('oslo_messaging_amqp/broadcast_prefix').with_value('') @@ -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',