add middlewares configuration

add middlewares configuration to gnocchi.conf

Change-Id: Ic05c390aca4e96a1107143017b77d6e6d5879c10
This commit is contained in:
Yuan Xiaohua
2017-02-23 14:22:11 +08:00
parent 5ec568db59
commit ea7c395af4
3 changed files with 12 additions and 2 deletions

View File

@@ -42,6 +42,10 @@
# HTTPProxyToWSGI middleware. # HTTPProxyToWSGI middleware.
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
# #
# [*middlewares*]
# (optional) Middlewares to use.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
# #
# [*host*] # [*host*]
@@ -65,6 +69,7 @@ class gnocchi::api (
$sync_db = false, $sync_db = false,
$auth_strategy = 'keystone', $auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $::os_service_default, $enable_proxy_headers_parsing = $::os_service_default,
$middlewares = $::os_service_default,
# DEPRECATED # DEPRECATED
$host = $::os_service_default, $host = $::os_service_default,
$port = $::os_service_default, $port = $::os_service_default,
@@ -133,6 +138,7 @@ 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/middlewares': value => $middlewares;
} }
oslo::middleware { 'gnocchi_config': oslo::middleware { 'gnocchi_config':

View File

@@ -0,0 +1,3 @@
---
deprecations:
- add middlewares configuration to gnocchi.conf.

View File

@@ -36,6 +36,7 @@ describe '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( params[:max_limit] )
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('oslo_middleware/enable_proxy_headers_parsing').with_value('<SERVICE DEFAULT>') is_expected.to contain_gnocchi_config('oslo_middleware/enable_proxy_headers_parsing').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('api/middlewares').with_value('<SERVICE DEFAULT>')
end end
[{:enabled => true}, {:enabled => false}].each do |param_hash| [{:enabled => true}, {:enabled => false}].each do |param_hash|