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: I2e769bf5de97552dcd361d0c01011d39eee960d9
This commit is contained in:
Iury Gregory Melo Ferreira
2016-05-19 00:17:14 -03:00
parent 45b2984732
commit a7fb105c8a
7 changed files with 33 additions and 23 deletions

View File

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

View File

@@ -139,10 +139,6 @@
# (optional) CA certificate file to use to verify connecting clients
# Defaults to false, not set_
#
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to false
#
# [*debug*]
# (Optional) Should the daemons log debug messages
# Defaults to false
@@ -206,6 +202,12 @@
# (optional) Accept clients using either SSL or plain TCP
# Defaults to false
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef
#
class manila (
$sql_connection = undef,
$sql_idle_timeout = undef,
@@ -240,7 +242,6 @@ class manila (
$use_syslog = undef,
$log_facility = undef,
$log_dir = undef,
$verbose = undef,
$debug = undef,
$storage_availability_zone = 'nova',
$rootwrap_config = '/etc/manila/rootwrap.conf',
@@ -257,12 +258,18 @@ class manila (
$amqp_ssl_cert_file = $::os_service_default,
$amqp_ssl_key_file = $::os_service_default,
$amqp_ssl_key_password = $::os_service_default,
# Deprecated
$verbose = undef,
) {
include ::manila::db
include ::manila::logging
include ::manila::params
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
if $use_ssl {
if !$cert_file {
fail('The cert_file parameter is required when use_ssl is set to true')

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 manila::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/manila',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@@ -107,20 +108,25 @@ class manila::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 manila::<myparam> first then manila::logging::<myparam>.
$use_syslog_real = pick($::manila::use_syslog,$use_syslog)
$use_stderr_real = pick($::manila::use_stderr,$use_stderr)
$log_facility_real = pick($::manila::log_facility,$log_facility)
$log_dir_real = pick($::manila::log_dir,$log_dir)
$verbose_real = pick($::manila::verbose,$verbose)
$debug_real = pick($::manila::debug,$debug)
oslo::log { 'manila_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

@@ -34,7 +34,6 @@ describe 'basic manila' do
rabbit_password => 'an_even_bigger_secret',
rabbit_host => '127.0.0.1',
debug => true,
verbose => true,
}
class { '::manila::db::mysql':
password => 'a_big_secret',

View File

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

View File

@@ -54,9 +54,6 @@ describe 'manila' do
is_expected.to contain_manila_config('oslo_messaging_rabbit/rabbit_userid').with(
:value => '<SERVICE DEFAULT>'
)
is_expected.to contain_manila_config('DEFAULT/verbose').with(
:value => '<SERVICE DEFAULT>'
)
is_expected.to contain_manila_config('DEFAULT/debug').with(
:value => '<SERVICE DEFAULT>'
)