Add control_exchange and option

Add control_exchange to configure an exchange name for message.

Change-Id: Ib9af4d5f01cbc4db011707f3f2ccac539db9b1e2
This commit is contained in:
ZhongShengping
2017-02-07 09:35:11 +08:00
parent dd28e733b6
commit d955533825
3 changed files with 17 additions and 0 deletions

View File

@@ -67,6 +67,12 @@
# (Optional) Seconds to wait for a response from a call. (integer value)
# 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) The rpc backend implementation to use, can be:
# rabbit (for rabbitmq)
@@ -447,6 +453,7 @@ class nova(
$database_max_overflow = undef,
$default_transport_url = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$control_exchange = $::os_service_default,
$rpc_backend = $::os_service_default,
$image_service = 'nova.image.glance.GlanceImageService',
# these glance params should be optional
@@ -732,6 +739,7 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
oslo::messaging::default { 'nova_config':
transport_url => $default_transport_url,
rpc_response_timeout => $rpc_response_timeout,
control_exchange => $control_exchange,
}
oslo::messaging::notifications { 'nova_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

@@ -61,6 +61,7 @@ describe 'nova' do
is_expected.to contain_nova_config('os_vif_linux_bridge/use_ipv6').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('DEFAULT/control_exchange').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('cinder/os_region_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_nova_config('cinder/catalog_info').with('value' => 'volumev2:cinderv2:publicURL')
is_expected.to contain_nova_config('DEFAULT/cpu_allocation_ratio').with_value('<SERVICE DEFAULT>')
@@ -82,6 +83,7 @@ describe 'nova' do
:image_service => 'nova.image.local.LocalImageService',
:default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:rpc_response_timeout => '30',
:control_exchange => 'nova',
:rpc_backend => 'rabbit',
:rabbit_host => 'rabbit',
:rabbit_userid => 'rabbit_user',
@@ -141,6 +143,8 @@ describe 'nova' do
it 'configures rabbit' do
is_expected.to contain_nova_config('DEFAULT/rpc_backend').with_value('rabbit')
is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('30')
is_expected.to contain_nova_config('DEFAULT/control_exchange').with_value('nova')
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_host').with_value('rabbit')
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_password').with_value('password').with_secret(true)
is_expected.to contain_nova_config('oslo_messaging_rabbit/rabbit_port').with_value('5673')