From d955533825a98b6da0b132793eb994689ebd6e40 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Tue, 7 Feb 2017 09:35:11 +0800 Subject: [PATCH] Add control_exchange and option Add control_exchange to configure an exchange name for message. Change-Id: Ib9af4d5f01cbc4db011707f3f2ccac539db9b1e2 --- manifests/init.pp | 8 ++++++++ ...add_messaging_default_parameters-51a35df791986123.yaml | 5 +++++ spec/classes/nova_init_spec.rb | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 releasenotes/notes/add_messaging_default_parameters-51a35df791986123.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 05efc1ce9..140988a6b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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': diff --git a/releasenotes/notes/add_messaging_default_parameters-51a35df791986123.yaml b/releasenotes/notes/add_messaging_default_parameters-51a35df791986123.yaml new file mode 100644 index 000000000..49fb3799a --- /dev/null +++ b/releasenotes/notes/add_messaging_default_parameters-51a35df791986123.yaml @@ -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. diff --git a/spec/classes/nova_init_spec.rb b/spec/classes/nova_init_spec.rb index df05b5644..7d6dabb58 100644 --- a/spec/classes/nova_init_spec.rb +++ b/spec/classes/nova_init_spec.rb @@ -61,6 +61,7 @@ describe 'nova' do is_expected.to contain_nova_config('os_vif_linux_bridge/use_ipv6').with_value('') is_expected.to contain_nova_config('DEFAULT/transport_url').with_value('') is_expected.to contain_nova_config('DEFAULT/rpc_response_timeout').with_value('') + is_expected.to contain_nova_config('DEFAULT/control_exchange').with_value('') is_expected.to contain_nova_config('cinder/os_region_name').with_value('') 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('') @@ -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')