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: I4b148ae18f5196951f7de2afdff2fe815becfdb6
This commit is contained in:
Iury Gregory Melo Ferreira 2016-05-18 23:16:16 -03:00
parent 03ef641fef
commit 7f70b7f548
8 changed files with 29 additions and 24 deletions

View File

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

View File

@ -33,7 +33,6 @@ node /designate/ {
}
class { '::keystone':
verbose => true,
validate_service => true,
catalog_type => 'sql',
enable_pki_setup => false,

View File

@ -20,10 +20,6 @@
# (optional) should the daemons log debug messages.
# Defaults to undef
#
# [*verbose*]
# (optional) should the daemons log verbose messages.
# Defaults to undef
#
# [*use_syslog*]
# (Optional) Use syslog for logging.
# Defaults to undef
@ -111,11 +107,13 @@
# (optional) DEPRECATED. Use rabbit_virtual_host
# Defaults to undef.
#
# [*verbose*]
# (optional) Deprecated. should the daemons log verbose messages.
# Defaults to undef
#
class designate(
$package_ensure = present,
$common_package_name = $::designate::params::common_package_name,
$verbose = undef,
$debug = undef,
$log_dir = undef,
$use_syslog = undef,
@ -138,8 +136,13 @@ class designate(
$notification_topics = 'notifications',
#DEPRECATED PARAMETER
$rabbit_virtualhost = undef,
$verbose = undef,
) inherits designate::params {
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
if $rabbit_virtualhost {
warning('The parameter rabbit_virtualhost is deprecated, use rabbit_virtual_host.')
$rabbit_virtual_host_real = $rabbit_virtualhost

View File

@ -4,10 +4,6 @@
#
# == parameters
#
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to 'false'
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to 'false'
@ -83,18 +79,23 @@
# it like this (string value).
# Defaults to undef.
# Example: instance_uuid_format='[instance: %(uuid)s] '
#
# [*log_date_format*]
# (optional) Format string for %%(asctime)s in log records.
# Defaults to undef.
# Example: 'Y-%m-%d %H:%M:%S'
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef
#
class designate::logging(
$use_syslog = false,
$use_stderr = true,
$log_facility = 'LOG_USER',
$log_dir = $::designate::params::log_dir,
$verbose = false,
$debug = false,
$logging_context_format_string = undef,
$logging_default_format_string = undef,
@ -107,20 +108,23 @@ class designate::logging(
$instance_format = undef,
$instance_uuid_format = undef,
$log_date_format = undef,
#Deprecated
$verbose = undef,
) inherits ::designate::params {
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 designate::<myparam> first then designate::logging::<myparam>.
$use_syslog_real = pick($::designate::use_syslog,$use_syslog)
$use_stderr_real = pick($::designate::use_stderr,$use_stderr)
$log_facility_real = pick($::designate::log_facility,$log_facility)
$log_dir_real = pick($::designate::log_dir, $log_dir)
$verbose_real = pick($::designate::verbose,$verbose)
$debug_real = pick($::designate::debug,$debug)
designate_config {
'DEFAULT/debug' : value => $debug_real;
'DEFAULT/verbose' : value => $verbose_real;
'DEFAULT/use_stderr' : value => $use_stderr_real;
'DEFAULT/use_syslog' : value => $use_syslog_real;
'DEFAULT/log_dir' : value => $log_dir_real;

View File

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

View File

@ -41,7 +41,6 @@ describe 'basic designate' do
rabbit_password => 'an_even_bigger_secret',
rabbit_host => '127.0.0.1',
debug => true,
verbose => true,
}
class { '::designate::api':
enabled => true,

View File

@ -9,7 +9,6 @@ describe 'designate' do
{
:package_ensure => 'installed',
:debug => 'False',
:verbose => 'False',
:root_helper => 'sudo designate-rootwrap /etc/designate/rootwrap.conf'
}
end

View File

@ -27,7 +27,6 @@ describe 'designate::logging' do
:use_stderr => false,
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:verbose => true,
:debug => true,
}
end
@ -58,7 +57,6 @@ describe 'designate::logging' do
it 'configures designate logging settins with default values' do
is_expected.to contain_designate_config('DEFAULT/use_syslog').with(:value => 'false')
is_expected.to contain_designate_config('DEFAULT/use_stderr').with(:value => 'true')
is_expected.to contain_designate_config('DEFAULT/verbose').with(:value => 'false')
is_expected.to contain_designate_config('DEFAULT/debug').with(:value => 'false')
end
end
@ -69,7 +67,6 @@ describe 'designate::logging' do
is_expected.to contain_designate_config('DEFAULT/use_stderr').with(:value => 'false')
is_expected.to contain_designate_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_designate_config('DEFAULT/log_dir').with(:value => '/var/log')
is_expected.to contain_designate_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_designate_config('DEFAULT/debug').with(:value => 'true')
end
end