Deprecate project_id and user_id options

Option "user_id" from group "statsd" is deprecated for removal.
Its value may be silently ignored in the future.
Option "project_id" from group "statsd" is deprecated for removal.
Its value may be silently ignored in the future

Change-Id: Ib2122af574075c4a83609116251478b3c37519a1
Closes-Bug: #1718848
This commit is contained in:
ZhongShengping 2017-09-22 14:14:05 +08:00
parent 1678055c44
commit 965a79945b
3 changed files with 24 additions and 14 deletions

View File

@ -5,12 +5,6 @@
# [*resource_id*]
# (required) Resource UUID to use to identify statsd in Gnocchi.
#
# [*user_id*]
# (required) User UUID to use to identify statsd in Gnocchi.
#
# [*project_id*]
# (required) Project UUID to use to identify statsd in Gnocchi.
#
# [*flush_delay*]
# (required) Delay between flushes.
#
@ -30,19 +24,38 @@
# (optional) Archive policy name to use when creating metrics.
# Defaults to undef.
#
# DEPRECATED PARAMETERS
#
# [*user_id*]
# (required) User UUID to use to identify statsd in Gnocchi.
# Defaults to undef.
#
# [*project_id*]
# (required) Project UUID to use to identify statsd in Gnocchi.
# Defaults to undef.
#
class gnocchi::statsd (
$resource_id,
$user_id,
$project_id,
$flush_delay,
$archive_policy_name = undef,
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
# DEPRECATED PARAMETERS
$user_id = undef,
$project_id = undef,
) inherits gnocchi::params {
include ::gnocchi::deps
if $user_id {
warning('user_id parameter is deprecated and will be removed in the future release.')
}
if $project_id {
warning('project_id parameter is deprecated and will be removed in the future release.')
}
package { 'gnocchi-statsd':
ensure => $package_ensure,
name => $::gnocchi::params::statsd_package_name,
@ -68,8 +81,6 @@ class gnocchi::statsd (
gnocchi_config {
'statsd/resource_id' : value => $resource_id;
'statsd/user_id' : value => $user_id;
'statsd/project_id' : value => $project_id;
'statsd/archive_policy_name' : value => $archive_policy_name;
'statsd/flush_delay' : value => $flush_delay;
}

View File

@ -0,0 +1,3 @@
---
deprecations:
- user_id and project_id options are now deprecated for removal.

View File

@ -6,8 +6,6 @@ describe 'gnocchi::statsd' do
{ :enabled => true,
:manage_service => true,
:resource_id => '07f26121-5777-48ba-8a0b-d70468133dd9',
:user_id => '07f26121-5777-48ba-8a0b-d70468133dd9',
:project_id => '07f26121-5777-48ba-8a0b-d70468133dd9',
:archive_policy_name => 'high',
:flush_delay => '200',
}
@ -28,8 +26,6 @@ describe 'gnocchi::statsd' do
it 'configures gnocchi statsd' do
is_expected.to contain_gnocchi_config('statsd/resource_id').with_value('07f26121-5777-48ba-8a0b-d70468133dd9')
is_expected.to contain_gnocchi_config('statsd/user_id').with_value('07f26121-5777-48ba-8a0b-d70468133dd9')
is_expected.to contain_gnocchi_config('statsd/project_id').with_value('07f26121-5777-48ba-8a0b-d70468133dd9')
is_expected.to contain_gnocchi_config('statsd/archive_policy_name').with_value('high')
is_expected.to contain_gnocchi_config('statsd/flush_delay').with_value('200')
end