From 456355e4709bfe4147b25449f2dab72d39decdfd Mon Sep 17 00:00:00 2001 From: Gael Chamoulaud Date: Tue, 14 Apr 2015 22:27:17 +0200 Subject: [PATCH] Move rabbit/kombu settings to oslo_messaging_rabbit section Kilo oslo-messaging deprecates rabbit/kombu settings in the DEFAULT section. Move these settings to proper oslo_messaging_rabbit section. Change-Id: I8cd5fb7b8074e0acd62535238fe73a4bb9869a5d Closes-bug: 1444161 Signed-off-by: Gael Chamoulaud --- manifests/init.pp | 48 +++++++-------- spec/classes/heat_init_spec.rb | 108 ++++++++++++++++----------------- 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 9a2d87b2..b6a7327d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -302,65 +302,65 @@ class heat( if $rpc_backend == 'heat.openstack.common.rpc.impl_kombu' { if $rabbit_hosts { - heat_config { 'DEFAULT/rabbit_host': ensure => absent } - heat_config { 'DEFAULT/rabbit_port': ensure => absent } - heat_config { 'DEFAULT/rabbit_hosts': + heat_config { 'oslo_messaging_rabbit/rabbit_host': ensure => absent } + heat_config { 'oslo_messaging_rabbit/rabbit_port': ensure => absent } + heat_config { 'oslo_messaging_rabbit/rabbit_hosts': value => join($rabbit_hosts, ',') } } else { - heat_config { 'DEFAULT/rabbit_host': value => $rabbit_host } - heat_config { 'DEFAULT/rabbit_port': value => $rabbit_port } - heat_config { 'DEFAULT/rabbit_hosts': + heat_config { 'oslo_messaging_rabbit/rabbit_host': value => $rabbit_host } + heat_config { 'oslo_messaging_rabbit/rabbit_port': value => $rabbit_port } + heat_config { 'oslo_messaging_rabbit/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" } } if size($rabbit_hosts) > 1 { - heat_config { 'DEFAULT/rabbit_ha_queues': value => true } + heat_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => true } } else { - heat_config { 'DEFAULT/rabbit_ha_queues': value => false } + heat_config { 'oslo_messaging_rabbit/rabbit_ha_queues': value => false } } heat_config { - 'DEFAULT/rabbit_userid' : value => $rabbit_userid; - 'DEFAULT/rabbit_password' : value => $rabbit_password, secret => true; - 'DEFAULT/rabbit_virtual_host' : value => $rabbit_virtual_host; - 'DEFAULT/rabbit_use_ssl' : value => $rabbit_use_ssl; + 'oslo_messaging_rabbit/rabbit_userid' : value => $rabbit_userid; + 'oslo_messaging_rabbit/rabbit_password' : value => $rabbit_password, secret => true; + 'oslo_messaging_rabbit/rabbit_virtual_host' : value => $rabbit_virtual_host; + 'oslo_messaging_rabbit/rabbit_use_ssl' : value => $rabbit_use_ssl; 'DEFAULT/amqp_durable_queues' : value => $amqp_durable_queues; } if $rabbit_use_ssl { if $kombu_ssl_ca_certs { - heat_config { 'DEFAULT/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs; } + heat_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs; } } else { - heat_config { 'DEFAULT/kombu_ssl_ca_certs': ensure => absent; } + heat_config { 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; } } if $kombu_ssl_certfile or $kombu_ssl_keyfile { heat_config { - 'DEFAULT/kombu_ssl_certfile': value => $kombu_ssl_certfile; - 'DEFAULT/kombu_ssl_keyfile': value => $kombu_ssl_keyfile; + 'oslo_messaging_rabbit/kombu_ssl_certfile': value => $kombu_ssl_certfile; + 'oslo_messaging_rabbit/kombu_ssl_keyfile': value => $kombu_ssl_keyfile; } } else { heat_config { - 'DEFAULT/kombu_ssl_certfile': ensure => absent; - 'DEFAULT/kombu_ssl_keyfile': ensure => absent; + 'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent; + 'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent; } } if $kombu_ssl_version { - heat_config { 'DEFAULT/kombu_ssl_version': value => $kombu_ssl_version; } + heat_config { 'oslo_messaging_rabbit/kombu_ssl_version': value => $kombu_ssl_version; } } else { - heat_config { 'DEFAULT/kombu_ssl_version': ensure => absent; } + heat_config { 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; } } } else { heat_config { - 'DEFAULT/kombu_ssl_version': ensure => absent; - 'DEFAULT/kombu_ssl_ca_certs': ensure => absent; - 'DEFAULT/kombu_ssl_certfile': ensure => absent; - 'DEFAULT/kombu_ssl_keyfile': ensure => absent; + 'oslo_messaging_rabbit/kombu_ssl_version': ensure => absent; + 'oslo_messaging_rabbit/kombu_ssl_ca_certs': ensure => absent; + 'oslo_messaging_rabbit/kombu_ssl_certfile': ensure => absent; + 'oslo_messaging_rabbit/kombu_ssl_keyfile': ensure => absent; } } diff --git a/spec/classes/heat_init_spec.rb b/spec/classes/heat_init_spec.rb index 533c5921..83f33078 100644 --- a/spec/classes/heat_init_spec.rb +++ b/spec/classes/heat_init_spec.rb @@ -180,58 +180,58 @@ describe 'heat' do shared_examples_for 'rabbit without HA support (with backward compatibility)' do it 'configures rabbit' do - is_expected.to contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] ) - is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] ) - is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_secret( true ) - is_expected.to contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] ) - is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false) - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent') + 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/rabbit_use_ssl').with_value(false) + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent') end - it { is_expected.to contain_heat_config('DEFAULT/rabbit_host').with_value( params[:rabbit_host] ) } - it { is_expected.to contain_heat_config('DEFAULT/rabbit_port').with_value( params[:rabbit_port] ) } - it { is_expected.to contain_heat_config('DEFAULT/rabbit_hosts').with_value( "#{params[:rabbit_host]}:#{params[:rabbit_port]}" ) } - it { is_expected.to contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('false') } + 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( "#{params[:rabbit_host]}:#{params[:rabbit_port]}" ) } + it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_ha_queues').with_value('false') } it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) } end shared_examples_for 'rabbit without HA support (without backward compatibility)' do it 'configures rabbit' do - is_expected.to contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] ) - is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_secret( true ) - is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] ) - is_expected.to contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] ) - is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false) - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent') + 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/rabbit_use_ssl').with_value(false) + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent') end - it { is_expected.to contain_heat_config('DEFAULT/rabbit_host').with_ensure('absent') } - it { is_expected.to contain_heat_config('DEFAULT/rabbit_port').with_ensure('absent') } - it { is_expected.to contain_heat_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) } - it { is_expected.to contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('false') } + it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') } + it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') } + 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('false') } it { is_expected.to contain_heat_config('DEFAULT/amqp_durable_queues').with_value(false) } end shared_examples_for 'rabbit with HA support' do it 'configures rabbit' do - is_expected.to contain_heat_config('DEFAULT/rabbit_userid').with_value( params[:rabbit_userid] ) - is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_value( params[:rabbit_password] ) - is_expected.to contain_heat_config('DEFAULT/rabbit_password').with_secret( true ) - is_expected.to contain_heat_config('DEFAULT/rabbit_virtual_host').with_value( params[:rabbit_virtual_host] ) - is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value(false) - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent') + 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/rabbit_use_ssl').with_value(false) + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent') end - it { is_expected.to contain_heat_config('DEFAULT/rabbit_host').with_ensure('absent') } - it { is_expected.to contain_heat_config('DEFAULT/rabbit_port').with_ensure('absent') } - it { is_expected.to contain_heat_config('DEFAULT/rabbit_hosts').with_value( params[:rabbit_hosts].join(',') ) } - it { is_expected.to contain_heat_config('DEFAULT/rabbit_ha_queues').with_value('true') } + it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_host').with_ensure('absent') } + it { is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_port').with_ensure('absent') } + 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('DEFAULT/amqp_durable_queues').with_value(true) } end @@ -277,11 +277,11 @@ describe 'heat' do end it do - is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('true') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_value('TLSv1') + is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1') end end @@ -293,11 +293,11 @@ describe 'heat' do end it do - is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('true') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_value('TLSv1') + is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('true') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_value('TLSv1') end end @@ -310,11 +310,11 @@ describe 'heat' do end it do - is_expected.to contain_heat_config('DEFAULT/rabbit_use_ssl').with_value('false') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') - is_expected.to contain_heat_config('DEFAULT/kombu_ssl_version').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/rabbit_use_ssl').with_value('false') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_ca_certs').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_certfile').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_keyfile').with_ensure('absent') + is_expected.to contain_heat_config('oslo_messaging_rabbit/kombu_ssl_version').with_ensure('absent') end end