Deprecate verbose option in logging

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

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

Change-Id: I284f8b22a59e930fbdd9909725f7cffc5fc4d183
This commit is contained in:
Iury Gregory Melo Ferreira 2016-05-19 00:00:16 -03:00
parent d720df04ea
commit 8eecfa9475
2 changed files with 14 additions and 10 deletions

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
@ -96,14 +92,19 @@
# (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 octavia::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/octavia',
$log_file = '/var/log/octavia/octavia.log',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@ -116,8 +117,15 @@ class octavia::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.')
}
if is_service_default($default_log_levels) {
$default_log_levels_real = $default_log_levels
} else {
@ -130,7 +138,6 @@ class octavia::logging(
'DEFAULT/syslog_log_facility' : value => $log_facility;
'DEFAULT/log_dir' : value => $log_dir;
'DEFAULT/log_file': value => $log_file;
'DEFAULT/verbose' : value => $verbose;
'DEFAULT/debug' : value => $debug;
'DEFAULT/default_log_levels' : value => $default_log_levels_real;
'DEFAULT/logging_context_format_string' : value => $logging_context_format_string;

View File

@ -28,7 +28,6 @@ describe 'octavia::logging' do
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/log/octavia.log',
:verbose => true,
:debug => true,
}
end
@ -62,7 +61,6 @@ describe 'octavia::logging' do
is_expected.to contain_octavia_config('DEFAULT/syslog_log_facility').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('DEFAULT/log_dir').with(:value => '/var/log/octavia')
is_expected.to contain_octavia_config('DEFAULT/log_file').with(:value => '/var/log/octavia/octavia.log')
is_expected.to contain_octavia_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end
end
@ -74,7 +72,6 @@ describe 'octavia::logging' do
is_expected.to contain_octavia_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_octavia_config('DEFAULT/log_dir').with(:value => '/var/log')
is_expected.to contain_octavia_config('DEFAULT/log_file').with(:value => '/var/log/octavia.log')
is_expected.to contain_octavia_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_octavia_config('DEFAULT/debug').with(:value => 'true')
end
end