Support setting paste_config setting on api.

Change-Id: I65ce3da1c8af997e0a659e0e65daab6ef645b8fa
This commit is contained in:
Sam Morrison 2017-08-17 12:22:36 +10:00
parent f6ef8011f8
commit 6a0225617f
3 changed files with 18 additions and 0 deletions

View File

@ -44,6 +44,10 @@
# HTTPProxyToWSGI middleware.
# Defaults to $::os_service_default.
#
# [*paste_config*]
# (Optional) Configuration file for WSGI definition of API
# Defaults to $::os_service_default.
#
# [*gnocchi_external_project_owner*]
# (optional) Gnocchi external project owner (usually Ceilometer project name)
# Defaults to 'services'
@ -58,6 +62,7 @@ class aodh::api (
$sync_db = false,
$auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $::os_service_default,
$paste_config = $::os_service_default,
$gnocchi_external_project_owner = 'services',
) inherits aodh::params {
@ -117,6 +122,7 @@ as a standalone service, or httpd for being run by a httpd server")
'api/gnocchi_external_project_owner': value => $gnocchi_external_project_owner;
'api/host': value => $host;
'api/port': value => $port;
'api/paste_config': value => $paste_config;
}
oslo::middleware { 'aodh_config':

View File

@ -0,0 +1,3 @@
---
features:
- Added ability to set paste_config option which is used by aodh-api

View File

@ -37,6 +37,7 @@ describe 'aodh::api' do
is_expected.to contain_aodh_config('api/host').with_value( params[:host] )
is_expected.to contain_aodh_config('api/port').with_value( params[:port] )
is_expected.to contain_aodh_config('api/gnocchi_external_project_owner').with_value( 'services' )
is_expected.to contain_aodh_config('api/paste_config').with_value('<SERVICE DEFAULT>')
is_expected.to contain_aodh_config('oslo_middleware/enable_proxy_headers_parsing').with_value('<SERVICE DEFAULT>')
end
@ -77,6 +78,14 @@ describe 'aodh::api' do
it { is_expected.to contain_aodh_config('oslo_middleware/enable_proxy_headers_parsing').with_value(true) }
end
context 'with paste_config' do
before do
params.merge!({:paste_config => '/etc/aodh/api-paste.ini' })
end
it { is_expected.to contain_aodh_config('api/paste_config').with_value('/etc/aodh/api-paste.ini') }
end
context 'with gnocchi_external_project_owner' do
before do
params.merge!({:gnocchi_external_project_owner => 'gnocchi-project' })