Browse Source

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
changes/20/580620/1
Matthias Bastian 4 years ago
parent
commit
7d240874e0
  1. 34
      manifests/api.pp
  2. 6
      releasenotes/notes/deprecate-host-and-port-parameters-7aa4609a9a7d2104.yaml
  3. 4
      spec/classes/aodh_api_spec.rb

34
manifests/api.pp

@ -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;
}

6
releasenotes/notes/deprecate-host-and-port-parameters-7aa4609a9a7d2104.yaml

@ -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.

4
spec/classes/aodh_api_spec.rb

@ -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(

Loading…
Cancel
Save