Add control_exchange option

Add control_exchange to configure an exchange name for message.

Change-Id: Iac2f30b5a4a70cd44dce9385256339d67d0f40da
This commit is contained in:
ZhongShengping 2017-01-28 14:07:15 +08:00
parent 2416150250
commit 40bfe5ac4a
3 changed files with 36 additions and 0 deletions

View File

@ -23,6 +23,12 @@
# transport://user:pass@host1:port[,hostN:portN]/virtual_host
# Defaults to $::os_service_default
#
# [*control_exchange*]
# (Optional) The default exchange under which topics are scoped. May be
# overridden by an exchange name specified in the transport_url
# option.
# Defaults to $::os_service_default
#
# [*rpc_backend*]
# (Optional) Use these options to configure the message system.
# Defaults to $::os_service_default.
@ -310,6 +316,7 @@ class heat(
$default_transport_url = $::os_service_default,
$rpc_backend = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$control_exchange = $::os_service_default,
$rabbit_ha_queues = $::os_service_default,
$rabbit_heartbeat_timeout_threshold = 0,
$rabbit_heartbeat_rate = $::os_service_default,
@ -496,6 +503,7 @@ deprecated. Please use heat::default_transport_url instead.")
oslo::messaging::default { 'heat_config':
transport_url => $default_transport_url,
rpc_response_timeout => $rpc_response_timeout,
control_exchange => $control_exchange,
}
oslo::middleware { 'heat_config':

View File

@ -0,0 +1,5 @@
---
features:
- Add new parameter "control_exchange", the default exchange under
which topics are scoped. May be overridden by an exchange name
specified in the transport_url option.

View File

@ -65,6 +65,7 @@ describe 'heat' do
it_configures 'with SSL disabled'
it_configures 'with SSL wrongly configured'
it_configures 'with enable_stack_adopt and enable_stack_abandon set'
it_configures 'with overriden transport_url parameter'
it_configures 'with notification_driver set to a string'
context 'with amqp rpc_backend value' do
@ -99,6 +100,12 @@ describe 'heat' do
is_expected.to contain_heat_config('DEFAULT/host').with_value('<SERVICE DEFAULT>')
end
it 'configures default transport_url' do
is_expected.to contain_heat_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_heat_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_heat_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>')
end
it 'configures max_template_size' do
is_expected.to contain_heat_config('DEFAULT/max_template_size').with_value('<SERVICE DEFAULT>')
end
@ -401,6 +408,22 @@ describe 'heat' do
end
end
shared_examples_for 'with overriden transport_url parameter' do
before do
params.merge!(
:default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:rpc_response_timeout => '120',
:control_exchange => 'heat',
)
end
it 'configures transport_url' do
is_expected.to contain_heat_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_heat_config('DEFAULT/rpc_response_timeout').with_value('120')
is_expected.to contain_heat_config('DEFAULT/control_exchange').with_value('heat')
end
end
shared_examples_for 'with notification_driver set to a string' do
before do
params.merge!(