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
This commit is contained in:
ZhongShengping 2018-05-24 10:19:03 +08:00
parent d87868123b
commit 2b14e1f379
3 changed files with 9 additions and 100 deletions

View File

@ -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,

View File

@ -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.

View File

@ -35,11 +35,6 @@ describe 'magnum' do
is_expected.to contain_magnum_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_host').with_value('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>').with_secret(true)
is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_port').with_value('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_port').with_value('<SERVICE DEFAULT>')
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('<SERVICE DEFAULT>')
is_expected.to contain_magnum_config('oslo_messaging_rabbit/rabbit_port').with_value('<SERVICE DEFAULT>')
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