Deprecate aodh::api::host and aodh::api::port

Both have no effect as aodh-api does not read them as of
Iefd6f4d9f76c69ed9b49483e1feda0b7dbe2cb81.

Change-Id: I0da4dc1ba52bae5becd5e2a9c0f008cbe2907446
This commit is contained in:
Matthias Bastian 2018-07-06 13:25:33 +02:00
parent 1143576ea7
commit 7d240874e0
3 changed files with 28 additions and 16 deletions

View File

@ -10,14 +10,6 @@
# (optional) Whether the service should be managed by Puppet.
# Defaults to true.
#
# [*host*]
# (optional) The aodh api bind address.
# Defaults to 0.0.0.0
#
# [*port*]
# (optional) The aodh api port.
# Defaults to 8042
#
# [*package_ensure*]
# (optional) ensure state for package.
# Defaults to 'present'
@ -52,18 +44,29 @@
# (optional) Gnocchi external project owner (usually Ceilometer project name)
# Defaults to 'services'
#
# DEPRECATED PARAMETERS
#
# [*host*]
# (optional) The aodh api bind address.
# Defaults to undef
#
# [*port*]
# (optional) The aodh api port.
# Defaults to undef
#
class aodh::api (
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$host = '0.0.0.0',
$port = '8042',
$service_name = $::aodh::params::api_service_name,
$sync_db = false,
$auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $::os_service_default,
$paste_config = $::os_service_default,
$gnocchi_external_project_owner = 'services',
# DEPRECATED PARAMETERS
$host = undef,
$port = undef,
) inherits aodh::params {
@ -75,6 +78,15 @@ class aodh::api (
include ::aodh::keystone::authtoken
}
if $host {
warning('host has no effect as of Newton and will be removed in a future \
release. aodh::wsgi::apache supports setting a host via bind_host.')
}
if $port {
warning('port has no effect as of Newton and will be removed in a future \
release. aodh::wsgi::apache supports setting a port.')
}
package { 'aodh-api':
ensure => $package_ensure,
name => $::aodh::params::api_package_name,
@ -120,8 +132,6 @@ as a standalone service, or httpd for being run by a httpd server")
aodh_config {
'api/gnocchi_external_project_owner': value => $gnocchi_external_project_owner;
'api/host': value => $host;
'api/port': value => $port;
'api/paste_config': value => $paste_config;
}

View File

@ -0,0 +1,6 @@
---
deprecations:
- aodh::api::host and aodh::api::port are deprecated and will be removed in a
future release. aodh-api itself is for testing only and does not use these
parameters. The production-ready alternative aodh::wsgi::apache supports
setting host and port via the bind_host and port parameters.

View File

@ -14,8 +14,6 @@ describe 'aodh::api' do
{ :enabled => true,
:manage_service => true,
:package_ensure => 'latest',
:port => '8042',
:host => '0.0.0.0',
}
end
@ -34,8 +32,6 @@ describe 'aodh::api' do
end
it 'configures 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_oslo__middleware('aodh_config').with(