From 4e6d5bff115f3277d00e8e6e5093214986976f34 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Thu, 24 May 2018 10:09:53 +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: I9c95be8843e51ac69c95d141507d767aa017afbf --- manifests/init.pp | 58 ------------------- ...ecated-rabbit-params-a7c25dc7022fc7c5.yaml | 6 ++ spec/classes/heat_init_spec.rb | 33 +---------- 3 files changed, 7 insertions(+), 90 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-rabbit-params-a7c25dc7022fc7c5.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 9bb9319a..e68e8cb8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -292,37 +292,6 @@ # take for evaluation. # Defaults to $::os_service_default. # -# === DEPRECATED PARAMETERS -# -# [*rabbit_host*] -# (Optional) IP or hostname of the rabbit server. -# Defaults to $::os_service_default. -# -# [*rabbit_port*] -# (Optional) Port of the rabbit server. -# Defaults to $::os_service_default. -# -# [*rabbit_hosts*] -# (Optional) Array of host:port (used with HA queues). -# If defined, will remove rabbit_host & rabbit_port parameters from config -# Defaults to $::os_service_default. -# -# [*rabbit_userid*] -# (Optional) User to connect to the rabbit server. -# Defaults to $::os_service_default. -# -# [*rabbit_password*] -# (Optional) Password to connect to the rabbit_server. -# Defaults to $::os_service_default. -# -# [*rabbit_virtual_host*] -# (Optional) Virtual_host to use. -# Defaults to $::os_service_default. -# -# [*rpc_backend*] -# (Optional) Use these options to configure the message system. -# Defaults to $::os_service_default. -# class heat( $package_ensure = 'present', $debug = undef, @@ -388,14 +357,6 @@ class heat( $auth_strategy = 'keystone', $yaql_memory_quota = $::os_service_default, $yaql_limit_iterators = $::os_service_default, - # DEPRECATED PARAMETERS - $rabbit_host = $::os_service_default, - $rabbit_port = $::os_service_default, - $rabbit_hosts = $::os_service_default, - $rabbit_userid = $::os_service_default, - $rabbit_password = $::os_service_default, - $rabbit_virtual_host = $::os_service_default, - $rpc_backend = $::os_service_default, ) { include ::heat::logging @@ -407,19 +368,6 @@ class heat( include ::heat::keystone::authtoken } - 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 - !is_service_default($rpc_backend) { - warning("heat::rabbit_host, heat::rabbit_hosts, heat::rabbit_password, \ -heat::rabbit_port, heat::rabbit_userid, heat::rabbit_virtual_host and \ -heat::rpc_backend are deprecated. Please use heat::default_transport_url \ -instead.") - } - package { 'heat-common': ensure => $package_ensure, name => $::heat::params::common_package_name, @@ -438,16 +386,10 @@ instead.") kombu_reconnect_delay => $kombu_reconnect_delay, kombu_failover_strategy => $kombu_failover_strategy, kombu_compression => $kombu_compression, - rabbit_userid => $rabbit_userid, - 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, amqp_durable_queues => $amqp_durable_queues, - rabbit_host => $rabbit_host, - rabbit_port => $rabbit_port, - rabbit_hosts => $rabbit_hosts, rabbit_ha_queues => $rabbit_ha_queues, } diff --git a/releasenotes/notes/remove-deprecated-rabbit-params-a7c25dc7022fc7c5.yaml b/releasenotes/notes/remove-deprecated-rabbit-params-a7c25dc7022fc7c5.yaml new file mode 100644 index 00000000..96dc6517 --- /dev/null +++ b/releasenotes/notes/remove-deprecated-rabbit-params-a7c25dc7022fc7c5.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + The deprecated heat::rabbit_host, heat::rabbit_hosts, heat::rabbit_password, + heat::rabbit_port, heat::rabbit_userid and heat::rabbit_virtual_host are now + removed. Please use heat::default_transport_url instead. diff --git a/spec/classes/heat_init_spec.rb b/spec/classes/heat_init_spec.rb index b79932ba..361204fc 100644 --- a/spec/classes/heat_init_spec.rb +++ b/spec/classes/heat_init_spec.rb @@ -13,11 +13,6 @@ describe 'heat' do :debug => 'False', :use_stderr => 'True', :log_dir => '/var/log/heat', - :rabbit_host => '', - :rabbit_port => 5672, - :rabbit_userid => '', - :rabbit_password => '', - :rabbit_virtual_host => '', :database_connection => 'mysql+pymysql://user@host/database', :database_idle_timeout => 3600, :flavor => 'keystone', @@ -37,14 +32,13 @@ describe 'heat' do context 'with rabbit_hosts parameter' do context 'with one server' do - before { params.merge!( :rabbit_hosts => ['127.0.0.1:5672'] ) } it_configures 'a heat base installation' it_configures 'rabbit without HA support (without backward compatibility)' end context 'with multiple servers' do before { params.merge!( - :rabbit_hosts => ['rabbit1:5672', 'rabbit2:5672'], + :rabbit_ha_queues => true, :amqp_durable_queues => true) } it_configures 'a heat base installation' it_configures 'rabbit with HA support' @@ -179,10 +173,6 @@ describe 'heat' do shared_examples_for 'rabbit without HA support (with backward compatibility)' do it 'configures rabbit' do - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_compression').with_value('') @@ -196,9 +186,6 @@ describe 'heat' do :kombu_ssl_version => '', ) end - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_value( params[:rabbit_host] ) } - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_value( params[:rabbit_port] ) } - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_hosts').with_value('') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('') } it { is_expected.to contain_heat_config('DEFAULT/rpc_response_timeout').with_value('') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('') } @@ -206,10 +193,6 @@ describe 'heat' do shared_examples_for 'rabbit without HA support (without backward compatibility)' do it 'configures rabbit' do - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_compression').with_value('') @@ -223,19 +206,12 @@ describe 'heat' do :kombu_ssl_version => '', ) end - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_value('') } - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_value('') } - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/amqp_durable_queues').with_value('') } end shared_examples_for 'rabbit with HA support' do it 'configures rabbit' do - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_compression').with_value('') @@ -249,9 +225,6 @@ describe 'heat' do :kombu_ssl_version => '', ) end - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_value('') } - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_value('') } - it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('true') } it { is_expected.to contain_heat_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(true) } end @@ -268,10 +241,6 @@ describe 'heat' do shared_examples_for 'rabbit with heartbeat configured' do it 'configures rabbit' do - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_userid').with_value( params[:rabbit_userid] ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_value( params[:rabbit_password] ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_password').with_secret( true ) - is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] ) is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_reconnect_delay').with_value('') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_failover_strategy').with_value('') is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_compression').with_value('')