Add rpc_response_timeout option

Add rpc_response_timeout to configure seconds time for waiting
for a response from a call.

Change-Id: Ib107713d8b2cc137e11c3d478f14f8a4f4d034a3
This commit is contained in:
ZhongShengping 2017-02-08 10:54:48 +08:00
parent 9a9fca0398
commit 370c0bf8fa
10 changed files with 77 additions and 31 deletions

View File

@ -161,7 +161,8 @@ class trove::api(
oslo::messaging::default { 'trove_config': oslo::messaging::default { 'trove_config':
transport_url => $::trove::default_transport_url, transport_url => $::trove::default_transport_url,
control_exchange => $::trove::control_exchange control_exchange => $::trove::control_exchange,
rpc_response_timeout => $::trove::rpc_response_timeout,
} }
if $auth_strategy == 'keystone' { if $auth_strategy == 'keystone' {

View File

@ -111,6 +111,7 @@ class trove::conductor(
oslo::messaging::default { 'trove_conductor_config': oslo::messaging::default { 'trove_conductor_config':
transport_url => $::trove::default_transport_url, transport_url => $::trove::default_transport_url,
control_exchange => $::trove::control_exchange, control_exchange => $::trove::control_exchange,
rpc_response_timeout => $::trove::rpc_response_timeout,
} }
oslo::messaging::notifications { 'trove_conductor_config': oslo::messaging::notifications { 'trove_conductor_config':

View File

@ -143,6 +143,11 @@ and trove::guestagent::rabbit_port are deprecated. Please use \
trove::guestagent::default_transport_url instead.") trove::guestagent::default_transport_url instead.")
} }
if $control_exchange {
warning("control_exchange parameter is deprecated. Please use \
trove::control_exchange instead.")
}
# basic service config # basic service config
trove_guestagent_config { trove_guestagent_config {
'DEFAULT/trove_auth_url': value => $auth_url; 'DEFAULT/trove_auth_url': value => $auth_url;
@ -156,7 +161,8 @@ trove::guestagent::default_transport_url instead.")
oslo::messaging::default { 'trove_guestagent_config': oslo::messaging::default { 'trove_guestagent_config':
transport_url => $default_transport_url, transport_url => $default_transport_url,
control_exchange => $::trove::control_exchange control_exchange => $::trove::control_exchange,
rpc_response_timeout => $::trove::rpc_response_timeout,
} }
# region name # region name

View File

@ -196,6 +196,10 @@
# (optional) Admin tenant name used to connect to nova. # (optional) Admin tenant name used to connect to nova.
# Defaults to 'admin' # Defaults to 'admin'
# #
# [*rpc_response_timeout*]
# (Optional) Seconds to wait for a response from a call.
# Defaults to $::os_service_default
#
# [*control_exchange*] # [*control_exchange*]
# (optional) Control exchange. # (optional) Control exchange.
# Defaults to 'trove'. # Defaults to 'trove'.
@ -321,6 +325,7 @@ class trove(
$nova_compute_url = false, $nova_compute_url = false,
$nova_proxy_admin_user = 'admin', $nova_proxy_admin_user = 'admin',
$nova_proxy_admin_tenant_name = 'admin', $nova_proxy_admin_tenant_name = 'admin',
$rpc_response_timeout = $::os_service_default,
$control_exchange = 'trove', $control_exchange = 'trove',
$cinder_url = false, $cinder_url = false,
$swift_url = false, $swift_url = false,

View File

@ -162,7 +162,8 @@ class trove::taskmanager(
oslo::messaging::default { 'trove_taskmanager_config': oslo::messaging::default { 'trove_taskmanager_config':
transport_url => $::trove::default_transport_url, transport_url => $::trove::default_transport_url,
control_exchange => $::trove::control_exchange control_exchange => $::trove::control_exchange,
rpc_response_timeout => $::trove::rpc_response_timeout,
} }
oslo::messaging::notifications { 'trove_taskmanager_config': oslo::messaging::notifications { 'trove_taskmanager_config':

View File

@ -0,0 +1,4 @@
---
features:
- Add new parameter "rpc_response_timeout", seconds to wait for a
response from a call

View File

@ -79,6 +79,8 @@ describe 'trove::api' do
is_expected.to contain_trove_config('DEFAULT/http_delete_rate').with_value('200') is_expected.to contain_trove_config('DEFAULT/http_delete_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/http_mgmt_post_rate').with_value('200') is_expected.to contain_trove_config('DEFAULT/http_mgmt_post_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/control_exchange').with_value('trove')
is_expected.to contain_trove_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>')
@ -246,6 +248,8 @@ describe 'trove::api' do
"class { 'trove': "class { 'trove':
nova_proxy_admin_pass => 'verysecrete', nova_proxy_admin_pass => 'verysecrete',
default_transport_url => 'rabbit://rabbit_user:password@localhost:5673', default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
rpc_response_timeout => '120',
control_exchange => 'openstack',
notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' } notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' }
class { '::trove::keystone::authtoken': class { '::trove::keystone::authtoken':
password => 'a_big_secret', password => 'a_big_secret',
@ -254,6 +258,8 @@ describe 'trove::api' do
it do it do
is_expected.to contain_trove_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_trove_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_trove_config('DEFAULT/rpc_response_timeout').with_value('120')
is_expected.to contain_trove_config('DEFAULT/control_exchange').with_value('openstack')
is_expected.to contain_trove_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_trove_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
end end
end end

View File

@ -35,6 +35,8 @@ describe 'trove::conductor' do
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_pass').with_value('verysecrete') is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_pass').with_value('verysecrete')
is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin') is_expected.to contain_trove_conductor_config('DEFAULT/nova_proxy_admin_tenant_name').with_value('admin')
is_expected.to contain_trove_conductor_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_conductor_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/control_exchange').with_value('trove')
is_expected.to contain_trove_conductor_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_conductor_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_userid').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_conductor_config('oslo_messaging_rabbit/rabbit_password').with_value('<SERVICE DEFAULT>')
@ -155,11 +157,15 @@ describe 'trove::conductor' do
"class { 'trove': "class { 'trove':
nova_proxy_admin_pass => 'verysecrete', nova_proxy_admin_pass => 'verysecrete',
default_transport_url => 'rabbit://rabbit_user:password@localhost:5673', default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
rpc_response_timeout => '120',
control_exchange => 'openstack',
notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' }" notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' }"
end end
it do it do
is_expected.to contain_trove_conductor_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_trove_conductor_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_trove_conductor_config('DEFAULT/rpc_response_timeout').with_value('120')
is_expected.to contain_trove_conductor_config('DEFAULT/control_exchange').with_value('openstack')
is_expected.to contain_trove_conductor_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_trove_conductor_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
end end
end end

View File

@ -35,6 +35,8 @@ describe 'trove::guestagent' do
is_expected.to contain_trove_guestagent_config('DEFAULT/os_region_name').with_value('RegionOne') is_expected.to contain_trove_guestagent_config('DEFAULT/os_region_name').with_value('RegionOne')
is_expected.to contain_trove_guestagent_config('DEFAULT/control_exchange').with_value('trove') is_expected.to contain_trove_guestagent_config('DEFAULT/control_exchange').with_value('trove')
is_expected.to contain_trove_guestagent_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_guestagent_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/control_exchange').with_value('trove')
is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>')
@ -99,10 +101,14 @@ describe 'trove::guestagent' do
let :pre_condition do let :pre_condition do
"class { 'trove': "class { 'trove':
nova_proxy_admin_pass => 'verysecrete', nova_proxy_admin_pass => 'verysecrete',
default_transport_url => 'rabbit://user:pass@host:1234/virt',}" default_transport_url => 'rabbit://user:pass@host:1234/virt',
rpc_response_timeout => '120',
control_exchange => 'openstack',}"
end end
it 'configures trove-guestagent with DEFAULT/transport_url' do it 'configures trove-guestagent with DEFAULT/transport_url' do
is_expected.to contain_trove_guestagent_config('DEFAULT/transport_url').with_value('rabbit://user:pass@host:1234/virt') is_expected.to contain_trove_guestagent_config('DEFAULT/transport_url').with_value('rabbit://user:pass@host:1234/virt')
is_expected.to contain_trove_guestagent_config('DEFAULT/rpc_response_timeout').with_value('120')
is_expected.to contain_trove_guestagent_config('DEFAULT/control_exchange').with_value('openstack')
end end
end end
@ -190,11 +196,15 @@ describe 'trove::guestagent' do
"class { 'trove': "class { 'trove':
nova_proxy_admin_pass => 'verysecrete', nova_proxy_admin_pass => 'verysecrete',
default_transport_url => 'rabbit://rabbit_user:password@localhost:5673', default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
rpc_response_timeout => '60',
control_exchange => 'exchange',
notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' }" notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' }"
end end
it do it do
is_expected.to contain_trove_guestagent_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_trove_guestagent_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_trove_guestagent_config('DEFAULT/rpc_response_timeout').with_value('60')
is_expected.to contain_trove_guestagent_config('DEFAULT/control_exchange').with_value('exchange')
is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_trove_guestagent_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
end end
end end

View File

@ -71,6 +71,8 @@ describe 'trove::taskmanager' do
is_expected.to contain_trove_taskmanager_config('DEFAULT/taskmanager_manager').with_value('trove.taskmanager.manager.Manager') is_expected.to contain_trove_taskmanager_config('DEFAULT/taskmanager_manager').with_value('trove.taskmanager.manager.Manager')
is_expected.to contain_file('/etc/trove/trove-guestagent.conf') is_expected.to contain_file('/etc/trove/trove-guestagent.conf')
is_expected.to contain_trove_taskmanager_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_taskmanager_config('DEFAULT/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/rpc_response_timeout').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/control_exchange').with_value('trove')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>') is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>')
@ -265,11 +267,15 @@ describe 'trove::taskmanager' do
"class { 'trove': "class { 'trove':
nova_proxy_admin_pass => 'verysecrete', nova_proxy_admin_pass => 'verysecrete',
default_transport_url => 'rabbit://rabbit_user:password@localhost:5673', default_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
rpc_response_timeout => '120',
control_exchange => 'openstack',
notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' }" notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673' }"
end end
it do it do
is_expected.to contain_trove_taskmanager_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_trove_taskmanager_config('DEFAULT/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
is_expected.to contain_trove_taskmanager_config('DEFAULT/rpc_response_timeout').with_value('120')
is_expected.to contain_trove_taskmanager_config('DEFAULT/control_exchange').with_value('openstack')
is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673') is_expected.to contain_trove_taskmanager_config('oslo_messaging_notifications/transport_url').with_value('rabbit://rabbit_user:password@localhost:5673')
end end
end end