Merge "Make [statsd] flush_delay optional"

This commit is contained in:
Zuul 2022-01-07 23:51:58 +00:00 committed by Gerrit Code Review
commit feafe4c64a
3 changed files with 20 additions and 4 deletions

View File

@ -6,7 +6,8 @@
# (required) Resource UUID to use to identify statsd in Gnocchi. # (required) Resource UUID to use to identify statsd in Gnocchi.
# #
# [*flush_delay*] # [*flush_delay*]
# (required) Delay between flushes. # (optional) Delay between flushes.
# Defaults to $::os_service_default
# #
# [*enabled*] # [*enabled*]
# (optional) Should the service be enabled. # (optional) Should the service be enabled.
@ -26,7 +27,7 @@
# #
class gnocchi::statsd ( class gnocchi::statsd (
$resource_id, $resource_id,
$flush_delay, $flush_delay = $::os_service_default,
$archive_policy_name = undef, $archive_policy_name = undef,
$manage_service = true, $manage_service = true,
$enabled = true, $enabled = true,

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
The ``gnocchi::statsd::flush_delay`` is now optional and defaults to
``$::os_service_default`` which effectively use the default value defined
in Gnocchi itself.

View File

@ -7,7 +7,6 @@ describe 'gnocchi::statsd' do
:manage_service => true, :manage_service => true,
:resource_id => '07f26121-5777-48ba-8a0b-d70468133dd9', :resource_id => '07f26121-5777-48ba-8a0b-d70468133dd9',
:archive_policy_name => 'high', :archive_policy_name => 'high',
:flush_delay => '200',
} }
end end
@ -27,7 +26,7 @@ describe 'gnocchi::statsd' do
it 'configures gnocchi statsd' do it 'configures gnocchi statsd' do
is_expected.to contain_gnocchi_config('statsd/resource_id').with_value('07f26121-5777-48ba-8a0b-d70468133dd9') is_expected.to contain_gnocchi_config('statsd/resource_id').with_value('07f26121-5777-48ba-8a0b-d70468133dd9')
is_expected.to contain_gnocchi_config('statsd/archive_policy_name').with_value('high') is_expected.to contain_gnocchi_config('statsd/archive_policy_name').with_value('high')
is_expected.to contain_gnocchi_config('statsd/flush_delay').with_value('200') is_expected.to contain_gnocchi_config('statsd/flush_delay').with_value('<SERVICE DEFAULT>')
end end
[{:enabled => true}, {:enabled => false}].each do |param_hash| [{:enabled => true}, {:enabled => false}].each do |param_hash|
@ -67,6 +66,16 @@ describe 'gnocchi::statsd' do
) )
end end
end end
context 'with flush_delay' do
before do
params.merge!({ :flush_delay => 10 })
end
it 'configures the parameter' do
is_expected.to contain_gnocchi_config('statsd/flush_delay').with_value(10)
end
end
end end
on_supported_os({ on_supported_os({