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: I1f7a00764f73f2131285667108d80fcde4642e6e
This commit is contained in:
Iury Gregory Melo Ferreira 2016-05-18 01:59:36 -03:00
parent 41df393552
commit 67cd93acd8
6 changed files with 28 additions and 19 deletions

View File

@ -62,12 +62,12 @@ configuration and extra functionality through types and providers.
The `sahara_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/sahara/sahara.conf` file.
```puppet
sahara_config { 'DEFAULT/verbose' :
value => true,
sahara_config { 'DEFAULT/use_neutron' :
value => True,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `use_neutron=True` in the `[DEFAULT]` section.
##### name

View File

@ -23,7 +23,6 @@ class { '::sahara::db::mysql':
# Then the common class
class { '::sahara':
database_connection => 'mysql+pymysql://sahara:a_big_secret@127.0.0.1:3306/sahara',
verbose => true,
debug => true,
admin_user => 'admin',
admin_password => 'secrets_everywhere',

View File

@ -8,10 +8,6 @@
# (Optional) Ensure state for package
# Defaults to 'present'.
#
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to undef.
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to undef.
@ -319,9 +315,12 @@
# (Optional) Receiver listening port.
# Defaults to undef.
#
# [*verbose*]
# (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef.
#
class sahara(
$package_ensure = 'present',
$verbose = undef,
$debug = undef,
$use_syslog = undef,
$use_stderr = undef,
@ -394,12 +393,17 @@ class sahara(
$amqp_password = $::os_service_default,
# DEPRECATED PARAMETERS
$zeromq_port = undef,
$verbose = undef,
) {
include ::sahara::params
include ::sahara::logging
include ::sahara::db
include ::sahara::policy
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
package { 'sahara-common':
ensure => $package_ensure,
name => $::sahara::params::common_package_name,

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.
@ -89,8 +85,13 @@
# 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 sahara::logging(
$verbose = $::os_service_default,
$debug = $::os_service_default,
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
@ -107,6 +108,8 @@ class sahara::logging(
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
# Deprecated
$verbose = undef,
) {
# NOTE(degorenko): In order to keep backward compatibility we rely on the pick function
@ -115,12 +118,14 @@ class sahara::logging(
$use_stderr_real = pick($::sahara::use_stderr, $use_stderr)
$log_facility_real = pick($::sahara::log_facility, $log_facility)
$log_dir_real = pick($::sahara::log_dir, $log_dir)
$verbose_real = pick($::sahara::verbose, $verbose)
$debug_real = pick($::sahara::debug, $debug)
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
oslo::log { 'sahara_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

@ -9,7 +9,6 @@ describe 'sahara::logging' do
let :log_params do
{
:verbose => 'true',
:debug => 'true',
:use_syslog => 'true',
:use_stderr => 'false',
@ -63,7 +62,6 @@ describe 'sahara::logging' do
it { is_expected.to contain_sahara_config('DEFAULT/use_stderr').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_sahara_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_sahara_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_sahara_config('DEFAULT/verbose').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_sahara_config('DEFAULT/log_dir').with_value('/var/log/sahara') }
end
@ -80,7 +78,6 @@ describe 'sahara::logging' do
shared_examples_for 'basic logging options passed' do
context 'with passed params' do
it { is_expected.to contain_sahara_config('DEFAULT/debug').with_value(true) }
it { is_expected.to contain_sahara_config('DEFAULT/verbose').with_value(true) }
it { is_expected.to contain_sahara_config('DEFAULT/use_syslog').with_value(true) }
it { is_expected.to contain_sahara_config('DEFAULT/use_stderr').with_value(false) }
it { is_expected.to contain_sahara_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0') }