From 2b14e1f3798f6f03ddeb887197c6d198c7f68753 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Thu, 24 May 2018 10:19:03 +0800 Subject: [PATCH] Remove deprecated rabbit params Remove the deprecated rabbit params which has been deprecated for two years. The default_transport_url has been present for a while now and should be used. Change-Id: Iba521efa97f9cfd3510c77f93cd627551e442c53 --- manifests/init.pp | 58 ------------------- ...ecated-rabbit-params-89f10f0abe8650d2.yaml | 6 ++ spec/classes/magnum_init_spec.rb | 45 +------------- 3 files changed, 9 insertions(+), 100 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-rabbit-params-89f10f0abe8650d2.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 71de2e9..10f1aa7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -72,37 +72,6 @@ # in the magnum config. # Defaults to false. # -# === DEPRECATED PARAMTERS -# -# [*rabbit_host*] -# (Optional) Host for rabbit server -# Defaults to $::os_service_default -# -# [*rabbit_hosts*] -# (Optional) List of clustered rabbit servers -# Defaults to $::os_service_default -# -# [*rabbit_port*] -# (Optional) Port for rabbit server -# Defaults to $::os_service_default -# -# [*rabbit_userid*] -# (Optional) Username used to connecting to rabbit -# Defaults to $::os_service_default -# -# [*rabbit_virtual_host*] -# (Optional) Virtual host for rabbit server -# Defaults to $::os_service_default -# -# [*rabbit_password*] -# (Optional) Password used to connect to rabbit -# Defaults to $::os_service_default -# -# [*rpc_backend*] -# (optional) The rpc backend implementation to use, can be: -# rabbit (for rabbitmq) -# Defaults to 'rabbit' -# class magnum( $package_ensure = 'present', $notification_transport_url = $::os_service_default, @@ -118,14 +87,6 @@ class magnum( $kombu_ssl_version = $::os_service_default, $kombu_failover_strategy = $::os_service_default, $purge_config = false, - # DEPRECATED PARAMTERS - $rabbit_host = $::os_service_default, - $rabbit_hosts = $::os_service_default, - $rabbit_port = $::os_service_default, - $rabbit_userid = $::os_service_default, - $rabbit_virtual_host = $::os_service_default, - $rabbit_password = $::os_service_default, - $rpc_backend = 'rabbit', ) { include ::magnum::deps @@ -144,26 +105,7 @@ class magnum( purge => $purge_config, } - if !is_service_default($rabbit_host) or - !is_service_default($rabbit_hosts) or - !is_service_default($rabbit_password) or - !is_service_default($rabbit_port) or - !is_service_default($rabbit_userid) or - !is_service_default($rabbit_virtual_host) or - $rpc_backend { - warning("magnum::rabbit_host, magnum::rabbit_hosts, magnum::rabbit_password, \ -magnum::rabbit_port, magnum::rabbit_userid, magnum::rabbit_virtual_host and \ -magnum::rpc_backend are deprecated. Please use magnum::default_transport_url \ -instead.") - } - oslo::messaging::rabbit { 'magnum_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_use_ssl => $rabbit_use_ssl, kombu_ssl_version => $kombu_ssl_version, kombu_ssl_keyfile => $kombu_ssl_keyfile, diff --git a/releasenotes/notes/remove-deprecated-rabbit-params-89f10f0abe8650d2.yaml b/releasenotes/notes/remove-deprecated-rabbit-params-89f10f0abe8650d2.yaml new file mode 100644 index 0000000..b3fb4b9 --- /dev/null +++ b/releasenotes/notes/remove-deprecated-rabbit-params-89f10f0abe8650d2.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + The deprecated magnum::rabbit_host, magnum::rabbit_hosts, magnum::rabbit_password, + magnum::rabbit_port, magnum::rabbit_userid and magnum::rabit_virtual_host are now + removed. Please use magnum::default_transport_url instead. diff --git a/spec/classes/magnum_init_spec.rb b/spec/classes/magnum_init_spec.rb index 3fe84fb..caac0f8 100644 --- a/spec/classes/magnum_init_spec.rb +++ b/spec/classes/magnum_init_spec.rb @@ -35,11 +35,6 @@ describe 'magnum' do is_expected.to contain_magnum_config('DEFAULT/transport_url').with_value('') is_expected.to contain_magnum_config('DEFAULT/rpc_response_timeout').with_value('') is_expected.to contain_magnum_config('DEFAULT/control_exchange').with_value('') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_host').with_value('') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_password').with_value('').with_secret(true) - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_port').with_value('') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_userid').with_value('') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('') is_expected.to contain_magnum_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('') end @@ -60,11 +55,6 @@ describe 'magnum' do :default_transport_url => 'rabbit://user:pass@host:1234/virt', :rpc_response_timeout => '120', :control_exchange => 'magnum', - :rabbit_host => '53.210.103.65', - :rabbit_port => '1234', - :rabbit_userid => 'me', - :rabbit_password => 'secrete', - :rabbit_virtual_host => 'vhost', :kombu_failover_strategy => 'shuffle', } end @@ -81,11 +71,6 @@ describe 'magnum' do is_expected.to contain_magnum_config('DEFAULT/transport_url').with_value('rabbit://user:pass@host:1234/virt') is_expected.to contain_magnum_config('DEFAULT/rpc_response_timeout').with_value('120') is_expected.to contain_magnum_config('DEFAULT/control_exchange').with_value('magnum') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_host').with_value('53.210.103.65') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_password').with_value('secrete').with_secret(true) - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_port').with_value('1234') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_userid').with_value('me') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('vhost') is_expected.to contain_magnum_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('shuffle') end @@ -96,33 +81,9 @@ describe 'magnum' do end end - context 'with rabbit_hosts parameter' do - let :params do - { :rabbit_hosts => ['rabbit:5673', 'rabbit2:5674'] } - end - - it 'configures rabbit' do - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_host').with_value('') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_port').with_value('') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_hosts').with_value('rabbit:5673,rabbit2:5674') - end - end - - context 'with rabbit_hosts parameter (one server)' do - let :params do - { :rabbit_hosts => ['rabbit:5673'] } - end - - it 'configures rabbit' do - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_host').with_value('') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_port').with_value('') - is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_hosts').with_value('rabbit:5673') - end - end - context 'with rabbit ssl enabled with kombu' do let :params do - { :rabbit_hosts => ['rabbit:5673'], + { :rabbit_use_ssl => true, :kombu_ssl_ca_certs => '/etc/ca.crt', :kombu_ssl_certfile => '/etc/certfile', @@ -144,7 +105,7 @@ describe 'magnum' do context 'with rabbit ssl enabled without kombu' do let :params do - { :rabbit_hosts => ['rabbit:5673'], + { :rabbit_use_ssl => 'true', } end @@ -162,7 +123,7 @@ describe 'magnum' do context 'with rabbit ssl disabled' do let :params do - { :rabbit_password => 'pass', + { :rabbit_use_ssl => false, } end