From f371c9f2cfde02e1823eed486562f9658acc590e Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Sat, 21 Jan 2017 20:03:39 +0800 Subject: [PATCH] Add control_exchange and rpc_response_timeout options Add control_exchange to configure an exchange name for message. Add rpc_response_timeout to configure seconds time for waiting for a response from a call. Change-Id: I05586dbb4b1599007eda2de546da135b9215cd19 --- manifests/api.pp | 16 +++++++++++++++- ...ging_default_parameters-9581a23f2e119345.yaml | 7 +++++++ spec/classes/barbican_api_spec.rb | 6 ++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/add_messaging_default_parameters-9581a23f2e119345.yaml diff --git a/manifests/api.pp b/manifests/api.pp index 4dbdd257..990ec34b 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -46,6 +46,16 @@ # would be, rabbit://user:pass@host:port/virtual_host # Defaults to $::os_service_default # +# [*rpc_response_timeout*] +# (Optional) Seconds to wait for a response from a call. +# 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 +# # [*notification_transport_url*] # (optional) Connection url for oslo messaging notifications backend. An # example rabbit url would be, rabbit://user:pass@host:port/virtual_host @@ -249,6 +259,8 @@ class barbican::api ( $max_allowed_request_size_in_bytes = $::os_service_default, $rpc_backend = $::os_service_default, $default_transport_url = $::os_service_default, + $rpc_response_timeout = $::os_service_default, + $control_exchange = $::os_service_default, $notification_transport_url = $::os_service_default, $notification_driver = $::os_service_default, $notification_topics = $::os_service_default, @@ -368,7 +380,9 @@ deprecated. Please use barbican::default_transport_url instead.") } oslo::messaging::default { 'barbican_config': - transport_url => $default_transport_url, + transport_url => $default_transport_url, + rpc_response_timeout => $rpc_response_timeout, + control_exchange => $control_exchange, } oslo::messaging::notifications { 'barbican_config': diff --git a/releasenotes/notes/add_messaging_default_parameters-9581a23f2e119345.yaml b/releasenotes/notes/add_messaging_default_parameters-9581a23f2e119345.yaml new file mode 100644 index 00000000..39d5e046 --- /dev/null +++ b/releasenotes/notes/add_messaging_default_parameters-9581a23f2e119345.yaml @@ -0,0 +1,7 @@ +--- +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. + - Add new parameter "rpc_response_timeout", seconds to wait for a + response from a call diff --git a/spec/classes/barbican_api_spec.rb b/spec/classes/barbican_api_spec.rb index a8c2c265..6116ba32 100644 --- a/spec/classes/barbican_api_spec.rb +++ b/spec/classes/barbican_api_spec.rb @@ -29,6 +29,8 @@ describe 'barbican::api' do :bind_port => '9311', :rpc_backend => 'rabbit', :default_transport_url => '', + :rpc_response_timeout => '', + :control_exchange => '', :notification_transport_url => '', :notification_driver => '', :notification_topics => '', @@ -74,6 +76,8 @@ describe 'barbican::api' do :bind_port => '9312', :rpc_backend => 'rabbit', :default_transport_url => 'rabbit://bugs:bugs_bunny@localhost:1234/rabbithost', + :rpc_response_timeout => '120', + :control_exchange => 'barbican', :notification_transport_url => 'rabbit://bugs:bugs_bunny@localhost:1234/rabbithost', :notification_driver => 'kombu', :notification_topics => 'notifications', @@ -159,6 +163,8 @@ describe 'barbican::api' do it 'configures rabbit' do is_expected.to contain_barbican_config('DEFAULT/rpc_backend').with_value(param_hash[:rpc_backend]) is_expected.to contain_barbican_config('DEFAULT/transport_url').with_value(param_hash[:default_transport_url]) + is_expected.to contain_barbican_config('DEFAULT/rpc_response_timeout').with_value(param_hash[:rpc_response_timeout]) + is_expected.to contain_barbican_config('DEFAULT/control_exchange').with_value(param_hash[:control_exchange]) is_expected.to contain_barbican_config('oslo_messaging_notifications/transport_url').with_value(param_hash[:notification_transport_url]) is_expected.to contain_barbican_config('oslo_messaging_notifications/driver').with_value(param_hash[:notification_driver]) is_expected.to contain_barbican_config('oslo_messaging_notifications/topics').with_value(param_hash[:notification_topics])