Support [api] operation_timeout
Change-Id: Iccc6b6f0632c7b20b0e2385467ae0cd459928128
This commit is contained in:
parent
d4416af168
commit
04301ef449
|
@ -39,7 +39,12 @@
|
||||||
#
|
#
|
||||||
# [*paste_config*]
|
# [*paste_config*]
|
||||||
# (Optional) Path to API paste configuration.
|
# (Optional) Path to API paste configuration.
|
||||||
# Defaults to $:;os_service_default
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
|
# [*operation_timeout*]
|
||||||
|
# (Optional) Number of seconds before timeout when attempting to do some
|
||||||
|
# operations.
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
# [*enable_proxy_headers_parsing*]
|
# [*enable_proxy_headers_parsing*]
|
||||||
# (Optional) Enable paste middleware to handle SSL requests through
|
# (Optional) Enable paste middleware to handle SSL requests through
|
||||||
|
@ -65,6 +70,7 @@ class gnocchi::api (
|
||||||
$sync_db = false,
|
$sync_db = false,
|
||||||
$auth_strategy = 'keystone',
|
$auth_strategy = 'keystone',
|
||||||
$paste_config = $::os_service_default,
|
$paste_config = $::os_service_default,
|
||||||
|
$operation_timeout = $::os_service_default,
|
||||||
$enable_proxy_headers_parsing = $::os_service_default,
|
$enable_proxy_headers_parsing = $::os_service_default,
|
||||||
$max_request_body_size = $::os_service_default,
|
$max_request_body_size = $::os_service_default,
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
|
@ -125,9 +131,10 @@ standalone service, or httpd for being run by a httpd server")
|
||||||
}
|
}
|
||||||
|
|
||||||
gnocchi_config {
|
gnocchi_config {
|
||||||
'api/max_limit': value => $max_limit;
|
'api/max_limit': value => $max_limit;
|
||||||
'api/auth_mode': value => $auth_strategy;
|
'api/auth_mode': value => $auth_strategy;
|
||||||
'api/paste_config': value => $paste_config;
|
'api/paste_config': value => $paste_config;
|
||||||
|
'api/operation_timeout': value => $operation_timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
oslo::middleware { 'gnocchi_config':
|
oslo::middleware { 'gnocchi_config':
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The ``gnochi::api::operation_timeout`` parameter has been added.
|
|
@ -11,10 +11,9 @@ describe 'gnocchi::api' do
|
||||||
end
|
end
|
||||||
|
|
||||||
let :params do
|
let :params do
|
||||||
{ :enabled => true,
|
{ :enabled => true,
|
||||||
:manage_service => true,
|
:manage_service => true,
|
||||||
:package_ensure => 'latest',
|
:package_ensure => 'latest',
|
||||||
:max_limit => '1000',
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -58,9 +57,10 @@ describe 'gnocchi::api' do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'configures gnocchi-api' do
|
it 'configures gnocchi-api' do
|
||||||
is_expected.to contain_gnocchi_config('api/max_limit').with_value( params[:max_limit] )
|
is_expected.to contain_gnocchi_config('api/max_limit').with_value(1000)
|
||||||
is_expected.to contain_gnocchi_config('api/auth_mode').with_value('keystone')
|
is_expected.to contain_gnocchi_config('api/auth_mode').with_value('keystone')
|
||||||
is_expected.to contain_gnocchi_config('api/paste_config').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_gnocchi_config('api/paste_config').with_value('<SERVICE DEFAULT>')
|
||||||
|
is_expected.to contain_gnocchi_config('api/operation_timeout').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_oslo__middleware('gnocchi_config').with(
|
is_expected.to contain_oslo__middleware('gnocchi_config').with(
|
||||||
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
|
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
|
||||||
:max_request_body_size => '<SERVICE DEFAULT>',
|
:max_request_body_size => '<SERVICE DEFAULT>',
|
||||||
|
@ -149,6 +149,14 @@ describe 'gnocchi::api' do
|
||||||
it_raises 'a Puppet::Error', /Invalid service_name/
|
it_raises 'a Puppet::Error', /Invalid service_name/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with max_limit' do
|
||||||
|
before do
|
||||||
|
params.merge!({:max_limit => 1001 })
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_gnocchi_config('api/max_limit').with_value(1001) }
|
||||||
|
end
|
||||||
|
|
||||||
context 'with paste_config' do
|
context 'with paste_config' do
|
||||||
before do
|
before do
|
||||||
params.merge!({:paste_config => 'api-paste.ini' })
|
params.merge!({:paste_config => 'api-paste.ini' })
|
||||||
|
@ -157,6 +165,14 @@ describe 'gnocchi::api' do
|
||||||
it { is_expected.to contain_gnocchi_config('api/paste_config').with_value('api-paste.ini') }
|
it { is_expected.to contain_gnocchi_config('api/paste_config').with_value('api-paste.ini') }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with operation_timeout' do
|
||||||
|
before do
|
||||||
|
params.merge!({:operation_timeout => 10 })
|
||||||
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_gnocchi_config('api/operation_timeout').with_value(10) }
|
||||||
|
end
|
||||||
|
|
||||||
context 'with enable_proxy_headers_parsing' do
|
context 'with enable_proxy_headers_parsing' do
|
||||||
before do
|
before do
|
||||||
params.merge!({:enable_proxy_headers_parsing => true })
|
params.merge!({:enable_proxy_headers_parsing => true })
|
||||||
|
|
Loading…
Reference in New Issue