Deprecate verbose option in logging

Option "verbose" from group "DEFAULT" is deprecated for removal.
The parameter has no effect.
-Deprecated verbose for logging and init
-Remove verbose in README Remove verbose from tests.

If this option is not set explicitly, there is no such warning.

Change-Id: I7056cd1cd965224d49e26520b310dfdfe748ec20
This commit is contained in:
Iury Gregory Melo Ferreira
2016-05-18 23:40:59 -03:00
parent ea4ef09066
commit 9ec9f039ea
6 changed files with 40 additions and 27 deletions

View File

@@ -47,12 +47,12 @@ gnocchi is a combination of Puppet manifest and ruby code to delivery configurat
The `gnocchi_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/gnocchi/gnocchi.conf` file.
```puppet
gnocchi_config { 'DEFAULT/verbose' :
gnocchi_config { 'DEFAULT/debug' :
value => true,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `debug=true` in the `[DEFAULT]` section.
##### name

View File

@@ -14,10 +14,6 @@
# any directory.
# Defaults to undef
#
# [*verbose*]
# (optional) Set log output to verbose output.
# Defaults to undef
#
# [*debug*]
# (optional) Set log output to debug output.
# Defaults to undef
@@ -38,17 +34,29 @@
# (optional) Connection url for the gnocchi database.
# Defaults to undef.
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (optional) Deprecated. Set log output to verbose output.
# Defaults to undef
#
class gnocchi (
$ensure_package = 'present',
$verbose = undef,
$debug = undef,
$use_syslog = undef,
$use_stderr = undef,
$log_dir = undef,
$log_facility = undef,
$database_connection = undef,
$ensure_package = 'present',
$debug = undef,
$use_syslog = undef,
$use_stderr = undef,
$log_dir = undef,
$log_facility = undef,
$database_connection = undef,
# Deprecated
$verbose = undef,
) inherits gnocchi::params {
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
include ::gnocchi::db
include ::gnocchi::logging

View File

@@ -4,10 +4,6 @@
#
# == parameters
#
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to $::os_service_default
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to $::os_service_default
@@ -84,18 +80,23 @@
# it like this (string value).
# Defaults to $::os_service_default
# example: instance_uuid_format='[instance: %(uuid)s] '
#
# [*log_date_format*]
# (optional) format string for %%(asctime)s in log records.
# Defaults to $::os_service_default
# example: 'y-%m-%d %h:%m:%s'
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef
#
class gnocchi::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/gnocchi',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@@ -108,20 +109,24 @@ class gnocchi::logging(
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
# Deprecated
$verbose = undef,
) {
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
# note(spredzy): in order to keep backward compatibility we rely on the pick function
# to use gnocchi::<myparam> first then gnocchi::logging::<myparam>.
$use_syslog_real = pick($::gnocchi::use_syslog,$use_syslog)
$use_stderr_real = pick($::gnocchi::use_stderr,$use_stderr)
$log_facility_real = pick($::gnocchi::log_facility,$log_facility)
$log_dir_real = pick($::gnocchi::log_dir,$log_dir)
$verbose_real = pick($::gnocchi::verbose,$verbose)
$debug_real = pick($::gnocchi::debug,$debug)
oslo::log { 'gnocchi_config':
debug => $debug_real,
verbose => $verbose_real,
use_syslog => $use_syslog_real,
use_stderr => $use_stderr_real,
log_dir => $log_dir_real,

View File

@@ -0,0 +1,4 @@
---
deprecations:
- verbose option is now deprecated for removal, the
parameter has no effect.

View File

@@ -23,7 +23,6 @@ describe 'basic gnocchi' do
}
'RedHat': {
class { '::gnocchi':
verbose => true,
debug => true,
database_connection => 'mysql+pymysql://gnocchi:a_big_secret@127.0.0.1/gnocchi?charset=utf8',
}

View File

@@ -27,7 +27,6 @@ describe 'gnocchi::logging' do
:use_stderr => false,
:log_facility => 'LOG_FOO',
:log_dir => '/tmp/gnocchi',
:verbose => true,
:debug => true,
}
end
@@ -60,7 +59,6 @@ describe 'gnocchi::logging' do
is_expected.to contain_gnocchi_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('DEFAULT/syslog_log_facility').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('DEFAULT/log_dir').with(:value => '/var/log/gnocchi')
is_expected.to contain_gnocchi_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end
end
@@ -71,7 +69,6 @@ describe 'gnocchi::logging' do
is_expected.to contain_gnocchi_config('DEFAULT/use_stderr').with(:value => 'false')
is_expected.to contain_gnocchi_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_gnocchi_config('DEFAULT/log_dir').with(:value => '/tmp/gnocchi')
is_expected.to contain_gnocchi_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_gnocchi_config('DEFAULT/debug').with(:value => 'true')
end
end