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: I1195b682a9aed4acbb2f198eeee043a9d8ee0ae4
This commit is contained in:
Iury Gregory Melo Ferreira 2016-05-18 00:07:17 -03:00
parent a19554a6f2
commit f7b1ed0857
9 changed files with 51 additions and 33 deletions

View File

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

View File

@ -29,10 +29,6 @@
# (optional) The state of the package
# Defaults to 'present'
#
# [*verbose*]
# (optional) Verbose logging
# Defaults to False
#
# [*debug*]
# (optional) Print debug messages in the logs
# Defaults to False
@ -72,11 +68,6 @@
# (optional) List of clustered rabbit servers. (string value)
# Defaults to $::os_service_default
#
# [*rabbit_user*]
# (optional) User to connect to the rabbit server.
# Defaults to undef.
# Deprecated, use rabbit_userid instead.
#
# [*rabbit_userid*]
# (optional) User used to connect to rabbitmq. (string value)
# Defaults to $::os_service_default
@ -280,10 +271,21 @@
# Enable dbsync
# Defaults to true
#
# DEPRECATED PARAMETERS
#
# [*rabbit_user*]
# (optional) User to connect to the rabbit server.
# Defaults to undef.
# Deprecated, use rabbit_userid instead.
#
# [*verbose*]
# (optional) Deprecated, Verbose logging
# Defaults to undef
class ironic (
$enabled = true,
$package_ensure = 'present',
$verbose = undef,
$debug = undef,
$my_ip = $::os_service_default,
$use_syslog = undef,
@ -341,13 +343,18 @@ class ironic (
$glance_api_insecure = false,
$sync_db = true,
# DEPRECATED PARAMETERS
$rabbit_user = undef,
$rabbit_user = undef,
$verbose = undef,
) {
include ::ironic::logging
include ::ironic::db
include ::ironic::params
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
if $rabbit_user {
warning('The rabbit_user parameter is deprecated. Please use rabbit_userid instead.')
$rabbit_user_real = $rabbit_user

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
@ -88,13 +84,18 @@
# (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 ironic::inspector::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/ironic-inspector',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@ -107,6 +108,8 @@ class ironic::inspector::logging(
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
#Deprecated
$verbose = undef,
) {
$debug_real = pick($::ironic::inspector::debug,$debug)
@ -116,9 +119,12 @@ class ironic::inspector::logging(
$default_log_levels_real = join(sort(join_keys_to_values($default_log_levels, '=')), ',')
}
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
ironic_inspector_config {
'DEFAULT/debug': value => $debug_real;
'DEFAULT/verbose': value => $verbose;
'DEFAULT/use_stderr': value => $use_stderr;
'DEFAULT/use_syslog': value => $use_syslog;
'DEFAULT/log_dir': value => $log_dir;

View File

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

@ -37,7 +37,6 @@ describe 'basic ironic' do
rabbit_host => '127.0.0.1',
database_connection => 'mysql+pymysql://ironic:a_big_secret@127.0.0.1/ironic?charset=utf8',
debug => true,
verbose => true,
enabled_drivers => ['pxe_ssh'],
}
class { '::ironic::db::mysql':

View File

@ -24,7 +24,6 @@ describe 'ironic' do
let :params do
{ :package_ensure => 'present',
:verbose => false,
:debug => false,
:enabled_drivers => ['pxe_ipmitool'],
:database_connection => 'sqlite:////var/lib/ironic/ironic.sqlite',

View File

@ -27,7 +27,6 @@ describe 'ironic::inspector::logging' do
:use_stderr => false,
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:verbose => true,
:debug => true,
}
end
@ -59,7 +58,6 @@ describe 'ironic::inspector::logging' do
is_expected.to contain_ironic_inspector_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_inspector_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_inspector_config('DEFAULT/log_dir').with(:value => '/var/log/ironic-inspector')
is_expected.to contain_ironic_inspector_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_inspector_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end
end
@ -70,7 +68,6 @@ describe 'ironic::inspector::logging' do
is_expected.to contain_ironic_inspector_config('DEFAULT/use_stderr').with(:value => 'false')
is_expected.to contain_ironic_inspector_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_ironic_inspector_config('DEFAULT/log_dir').with(:value => '/var/log')
is_expected.to contain_ironic_inspector_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_ironic_inspector_config('DEFAULT/debug').with(:value => 'true')
end
end

View File

@ -27,7 +27,6 @@ describe 'ironic::logging' do
:use_stderr => false,
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:verbose => true,
:debug => true,
}
end
@ -59,7 +58,6 @@ describe 'ironic::logging' do
is_expected.to contain_ironic_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('DEFAULT/log_dir').with(:value => '/var/log/ironic')
is_expected.to contain_ironic_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_ironic_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end
end
@ -70,7 +68,6 @@ describe 'ironic::logging' do
is_expected.to contain_ironic_config('DEFAULT/use_stderr').with(:value => 'false')
is_expected.to contain_ironic_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_ironic_config('DEFAULT/log_dir').with(:value => '/var/log')
is_expected.to contain_ironic_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_ironic_config('DEFAULT/debug').with(:value => 'true')
end
end