Deprecate support for tenant_name_discovery
... because the option was deprecated in favor of the new identity_name_discovery option. Depends-on: https://review.opendev.org/943892 Change-Id: I8121285d39fab726ff548ca84767620fb03ffbd6
This commit is contained in:
@@ -82,7 +82,7 @@
|
||||
# (Optional) Batch size of samples to send to notification agent.
|
||||
# Defaults to $facts['os_service_default'].
|
||||
#
|
||||
# [*tenant_name_discovery*]
|
||||
# [*identity_name_discovery*]
|
||||
# (Optional) Identify user and project names from polled metrics.
|
||||
# Defaults to $facts['os_service_default'].
|
||||
#
|
||||
@@ -109,6 +109,12 @@
|
||||
# (Optional) List of directories with YAML files used to create pollsters.
|
||||
# Defaults to $facts['os_service_default'].
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*tenant_name_discovery*]
|
||||
# (Optional) Identify user and project names from polled metrics.
|
||||
# Defaults to undef
|
||||
#
|
||||
class ceilometer::agent::polling (
|
||||
Boolean $manage_service = true,
|
||||
Boolean $enabled = true,
|
||||
@@ -127,17 +133,27 @@ class ceilometer::agent::polling (
|
||||
Optional[Hash] $polling_config = undef,
|
||||
$cfg_file = $facts['os_service_default'],
|
||||
$batch_size = $facts['os_service_default'],
|
||||
$tenant_name_discovery = $facts['os_service_default'],
|
||||
$identity_name_discovery = $facts['os_service_default'],
|
||||
$ignore_disabled_projects = $facts['os_service_default'],
|
||||
$enable_notifications = $facts['os_service_default'],
|
||||
$enable_prometheus_exporter = $facts['os_service_default'],
|
||||
$prometheus_listen_addresses = $facts['os_service_default'],
|
||||
$pollsters_definitions_dirs = $facts['os_service_default'],
|
||||
# DEPRECATED PARAMETERS
|
||||
$tenant_name_discovery = undef,
|
||||
) inherits ceilometer {
|
||||
|
||||
include ceilometer::deps
|
||||
include ceilometer::params
|
||||
|
||||
if $tenant_name_discovery != undef {
|
||||
warning("The tenant_name_discovery parameter is deprecated. \
|
||||
Use the identity_name_discovery parameter instead.")
|
||||
$identity_name_discovery_real = $tenant_name_discovery
|
||||
} else {
|
||||
$identity_name_discovery_real = $identity_name_discovery
|
||||
}
|
||||
|
||||
if $central_namespace {
|
||||
$central_namespace_name = 'central'
|
||||
} else {
|
||||
@@ -243,7 +259,7 @@ class ceilometer::agent::polling (
|
||||
|
||||
ceilometer_config {
|
||||
'polling/batch_size': value => $batch_size;
|
||||
'polling/tenant_name_discovery': value => $tenant_name_discovery;
|
||||
'polling/identity_name_discovery': value => $identity_name_discovery_real;
|
||||
'polling/ignore_disabled_projects': value => $ignore_disabled_projects;
|
||||
'polling/pollsters_definitions_dirs': value => join(any2array($pollsters_definitions_dirs), ',');
|
||||
'polling/enable_notifications': value => $enable_notifications;
|
||||
@@ -251,6 +267,11 @@ class ceilometer::agent::polling (
|
||||
'polling/prometheus_listen_addresses': value => join(any2array($prometheus_listen_addresses), ',');
|
||||
}
|
||||
|
||||
# TODO(tkajinam): Remove this after 2025.1 release
|
||||
ceilometer_config {
|
||||
'polling/tenant_name_discovery': ensure => absent;
|
||||
}
|
||||
|
||||
if $manage_service {
|
||||
if $enabled {
|
||||
$service_ensure = 'running'
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
deprecations:
|
||||
- |
|
||||
The ``ceilometer::agent::polling::tenant_name_discovery`` parameter has
|
||||
been deprecated in favor of the new ``identity_name_discovery`` parameter.
|
||||
@@ -72,7 +72,7 @@ describe 'ceilometer::agent::polling' do
|
||||
|
||||
it { should contain_ceilometer_config('polling/batch_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { should_not contain_file('polling') }
|
||||
it { should contain_ceilometer_config('polling/tenant_name_discovery').with_value('<SERVICE DEFAULT>') }
|
||||
it { should contain_ceilometer_config('polling/identity_name_discovery').with_value('<SERVICE DEFAULT>') }
|
||||
it { should contain_ceilometer_config('polling/ignore_disabled_projects').with_value('<SERVICE DEFAULT>') }
|
||||
it { should contain_ceilometer_config('polling/enable_notifications').with_value('<SERVICE DEFAULT>') }
|
||||
it { should contain_ceilometer_config('polling/enable_prometheus_exporter').with_value('<SERVICE DEFAULT>') }
|
||||
@@ -110,7 +110,7 @@ describe 'ceilometer::agent::polling' do
|
||||
context 'when common parameters are set' do
|
||||
before do
|
||||
params.merge!(
|
||||
:tenant_name_discovery => true,
|
||||
:identity_name_discovery => true,
|
||||
:ignore_disabled_projects => false,
|
||||
:enable_notifications => true,
|
||||
:enable_prometheus_exporter => false,
|
||||
@@ -120,7 +120,7 @@ describe 'ceilometer::agent::polling' do
|
||||
end
|
||||
|
||||
it {
|
||||
should contain_ceilometer_config('polling/tenant_name_discovery').with_value(true)
|
||||
should contain_ceilometer_config('polling/identity_name_discovery').with_value(true)
|
||||
should contain_ceilometer_config('polling/ignore_disabled_projects').with_value(false)
|
||||
should contain_ceilometer_config('polling/enable_notifications').with_value(true)
|
||||
should contain_ceilometer_config('polling/enable_prometheus_exporter').with_value(false)
|
||||
|
||||
Reference in New Issue
Block a user