Deprecate support for [api] middlewares

... because the parameter was deprecated in gnocchi 1.3.0[1] and was
removed in gnocchi 2.0.0[2].

[1] 7000300646
[2] 7e56cd6712

Change-Id: I7f52310b4f66813b30313d55a2d71ab3cf54493e
This commit is contained in:
Takashi Kajinami 2021-11-01 20:18:34 +09:00
parent aca4626cb2
commit be05efdc44
3 changed files with 19 additions and 6 deletions

View File

@ -46,9 +46,11 @@
# (Optional) Set max request body size
# Defaults to $::os_service_default.
#
# DEPRECATED PARAMETERS
#
# [*middlewares*]
# (optional) Middlewares to use.
# Defaults to $::os_service_default
# Defaults to undef
#
class gnocchi::api (
$manage_service = true,
@ -60,12 +62,20 @@ class gnocchi::api (
$auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $::os_service_default,
$max_request_body_size = $::os_service_default,
$middlewares = $::os_service_default,
# DEPRECATED PARAMETERS
$middlewares = undef,
) inherits gnocchi::params {
include gnocchi::deps
include gnocchi::policy
if $middlewares != undef {
warning('The gnocchi::api::middleware parameter is deprecated and has no effect')
}
gnocchi_config {
'api/middlewares': ensure => absent;
}
package { 'gnocchi-api':
ensure => $package_ensure,
name => $::gnocchi::params::api_package_name,
@ -112,9 +122,8 @@ standalone service, or httpd for being run by a httpd server")
}
gnocchi_config {
'api/max_limit': value => $max_limit;
'api/auth_mode': value => $auth_strategy;
'api/middlewares': value => $middlewares;
'api/max_limit': value => $max_limit;
'api/auth_mode': value => $auth_strategy;
}
oslo::middleware { 'gnocchi_config':

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The ``gnocchi::api::middlewares`` parameter has been deprecated and will be
removed in a future release. The parmaeter has no effect now.

View File

@ -60,7 +60,6 @@ describe '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/auth_mode').with_value('keystone')
is_expected.to contain_gnocchi_config('api/middlewares').with_value('<SERVICE DEFAULT>')
is_expected.to contain_oslo__middleware('gnocchi_config').with(
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
:max_request_body_size => '<SERVICE DEFAULT>',