Do not hard-code defaults of [filter:dlo] parameters
Currently all default values defined in swift::proxy::dlo are same as the ones defined in swift itself. This change removes these redundant defaults and make service defaults used instead. Change-Id: I9f69f0a7cbace6551c68b69ebc2ed8b08b8bb1bd
This commit is contained in:
@@ -8,17 +8,18 @@
|
|||||||
# == Parameters
|
# == Parameters
|
||||||
#
|
#
|
||||||
# [*rate_limit_after_segment*]
|
# [*rate_limit_after_segment*]
|
||||||
# Start rate-limiting DLO segment serving after the Nth segment of a segmented object.
|
# (Optional) Start rate-limiting DLO segment serving after the Nth segment of
|
||||||
# Default to 10.
|
# a segmented object.
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*rate_limit_segments_per_sec*]
|
# [*rate_limit_segments_per_sec*]
|
||||||
# Once segment rate-limiting kicks in for an object, limit segments served to N per second.
|
# (Optional) Once segment rate-limiting kicks in for an object, limit segments
|
||||||
# 0 means no rate-limiting.
|
# served to N per second. 0 means no rate-limiting.
|
||||||
# Default to 1.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*max_get_time*]
|
# [*max_get_time*]
|
||||||
# Time limit on GET requests (seconds).
|
# (Optional) Time limit on GET requests (seconds).
|
||||||
# Default to 86400.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# == Authors
|
# == Authors
|
||||||
#
|
#
|
||||||
@@ -29,9 +30,9 @@
|
|||||||
# Copyright 2015 Mirantis Inc, unless otherwise noted.
|
# Copyright 2015 Mirantis Inc, unless otherwise noted.
|
||||||
#
|
#
|
||||||
class swift::proxy::dlo (
|
class swift::proxy::dlo (
|
||||||
$rate_limit_after_segment = '10',
|
$rate_limit_after_segment = $::os_service_default,
|
||||||
$rate_limit_segments_per_sec = '1',
|
$rate_limit_segments_per_sec = $::os_service_default,
|
||||||
$max_get_time = '86400'
|
$max_get_time = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include swift::deps
|
include swift::deps
|
||||||
|
@@ -4,23 +4,23 @@ describe 'swift::proxy::dlo' do
|
|||||||
shared_examples 'swift::proxy::dlo' do
|
shared_examples 'swift::proxy::dlo' do
|
||||||
describe "when using default parameters" do
|
describe "when using default parameters" do
|
||||||
it { is_expected.to contain_swift_proxy_config('filter:dlo/use').with_value('egg:swift#dlo') }
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/use').with_value('egg:swift#dlo') }
|
||||||
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_after_segment').with_value('10') }
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_after_segment').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_segments_per_sec').with_value('1') }
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_segments_per_sec').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_swift_proxy_config('filter:dlo/max_get_time').with_value('86400') }
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/max_get_time').with_value('<SERVICE DEFAULT>') }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "when overriding default parameters" do
|
describe "when overriding default parameters" do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:rate_limit_after_segment => '30',
|
:rate_limit_after_segment => '10',
|
||||||
:rate_limit_segments_per_sec => '5',
|
:rate_limit_segments_per_sec => '1',
|
||||||
:max_get_time => '6400',
|
:max_get_time => '86400',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_after_segment').with_value('30') }
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_after_segment').with_value('10') }
|
||||||
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_segments_per_sec').with_value('5') }
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/rate_limit_segments_per_sec').with_value('1') }
|
||||||
it { is_expected.to contain_swift_proxy_config('filter:dlo/max_get_time').with_value('6400') }
|
it { is_expected.to contain_swift_proxy_config('filter:dlo/max_get_time').with_value('86400') }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user