Avoid hard-coding default of http_*_rate parameters

The current hard-coded default values are exactly same as the default
values in Trove, thus can be replaced by $::os_service_default.

Change-Id: I241355d278f23ac05f42ef0150f41cc2a5795abb
This commit is contained in:
Takashi Kajinami 2022-06-24 18:15:18 +09:00
parent 667028ea26
commit df1c3e258e
2 changed files with 15 additions and 15 deletions

View File

@ -68,23 +68,23 @@
#
# [*http_get_rate*]
# (optional) Default rate limit of GET request.
# Defaults to 200.
# Defaults to $::os_service_default.
#
# [*http_post_rate*]
# (optional) Default rate limit of POST request.
# Defaults to 200.
# Defaults to $::os_service_default.
#
# [*http_put_rate*]
# (optional) Default rate limit of PUT request.
# Defaults to 200.
# Defaults to $::os_service_default.
#
# [*http_delete_rate*]
# (optional) Default rate limit of DELETE request.
# Defaults to 200.
# Defaults to $::os_service_default.
#
# [*http_mgmt_post_rate*]
# (optional) Default rate limit of mgmt post request.
# Defaults to 200.
# Defaults to $::os_service_default.
#
# [*auth_strategy*]
# (optional) The strategy to use for authentication.
@ -104,11 +104,11 @@ class trove::api(
$cert_file = false,
$key_file = false,
$ca_file = false,
$http_get_rate = 200,
$http_post_rate = 200,
$http_put_rate = 200,
$http_delete_rate = 200,
$http_mgmt_post_rate = 200,
$http_get_rate = $::os_service_default,
$http_post_rate = $::os_service_default,
$http_put_rate = $::os_service_default,
$http_delete_rate = $::os_service_default,
$http_mgmt_post_rate = $::os_service_default,
$manage_service = true,
$package_ensure = 'present',
$auth_strategy = 'keystone',

View File

@ -67,11 +67,11 @@ describe 'trove::api' do
is_expected.to contain_trove_config('DEFAULT/bind_port').with_value('8779')
is_expected.to contain_trove_config('DEFAULT/backlog').with_value('4096')
is_expected.to contain_trove_config('DEFAULT/trove_api_workers').with_value('8')
is_expected.to contain_trove_config('DEFAULT/http_get_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/http_post_rate').with_value('200')
is_expected.to contain_trove_config('DEFAULT/http_put_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_get_rate').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/http_post_rate').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/http_put_rate').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/http_delete_rate').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/http_mgmt_post_rate').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/taskmanager_queue').with_value('taskmanager')
is_expected.to contain_trove_config('ssl/cert_file').with_ensure('absent')
is_expected.to contain_trove_config('ssl/key_file').with_ensure('absent')