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 examples and README
-Remove verbose from tests.
If this option is not set explicitly, there is no such warning.

Change-Id: I573b2480195df2e7b390245d418ec5535c8e2cdd
This commit is contained in:
Erickson Santos 2016-05-16 15:09:04 -03:00
parent 5278c9da8f
commit d4f5963461
6 changed files with 31 additions and 22 deletions

View File

@ -60,7 +60,6 @@ class { 'cinder':
database_connection => 'mysql://cinder:secret_block_password@openstack-controller.example.com/cinder',
rabbit_password => 'secret_rpc_password_for_blocks',
rabbit_host => 'openstack-controller.example.com',
verbose => true,
}
class { 'cinder::api':
@ -86,7 +85,6 @@ class { 'cinder':
database_connection => 'mysql://cinder:secret_block_password@openstack-controller.example.com/cinder',
rabbit_password => 'secret_rpc_password_for_blocks',
rabbit_host => 'openstack-controller.example.com',
verbose => true,
}
class { 'cinder::volume': }
@ -103,7 +101,6 @@ class { 'cinder':
database_connection => 'mysql://cinder:secret_block_password@openstack-controller.example.com/cinder',
rabbit_password => 'secret_rpc_password_for_blocks',
rabbit_host => 'openstack-controller.example.com',
verbose => true,
}
class { 'cinder::volume': }
@ -175,12 +172,12 @@ The `cinder_config` provider is a children of the ini_setting provider.
It allows one to write an entry in the `/etc/cinder/cinder.conf` file.
```puppet
cinder_config { 'DEFAULT/verbose' :
value => true,
cinder_config { 'DEFAULT/api_paste_config' :
value => '/etc/cinder/api-paste.ini',
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `api_paste_config=/etc/cinder/api-paste.ini` in the `[DEFAULT]` section.
##### name

View File

@ -8,9 +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
@ -286,6 +283,12 @@
# in the cinder config.
# Defaults to false.
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (Optional) DEPRECATED. Should the daemons log verbose messages
# Defaults to undef.
#
class cinder (
$database_connection = undef,
$database_idle_timeout = undef,
@ -340,7 +343,6 @@ class cinder (
$use_stderr = undef,
$log_facility = undef,
$log_dir = '/var/log/cinder',
$verbose = undef,
$debug = undef,
$storage_availability_zone = 'nova',
$default_availability_zone = false,
@ -351,6 +353,8 @@ class cinder (
$image_conversion_dir = $::os_service_default,
$host = $::os_service_default,
$purge_config = false,
# DEPRECATED PARAMETERS
$verbose = undef,
) inherits cinder::params {
@ -366,6 +370,10 @@ class cinder (
}
}
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
# this anchor is used to simplify the graph between cinder components by
# allowing a resource to serve as a point where the configuration of cinder begins
anchor { 'cinder-start': }

View File

@ -3,11 +3,6 @@
# Cinder logging configuration
#
# === 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
@ -90,12 +85,17 @@
# 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 cinder::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/cinder',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@ -108,20 +108,24 @@ class cinder::logging(
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
# DEPRECATED PARAMETERS
$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 cinder::<myparam> if cinder::logging::<myparam> isn't specified.
$use_syslog_real = pick($::cinder::use_syslog,$use_syslog)
$use_stderr_real = pick($::cinder::use_stderr,$use_stderr)
$log_facility_real = pick($::cinder::log_facility,$log_facility)
$log_dir_real = pick($::cinder::log_dir,$log_dir)
$verbose_real = pick($::cinder::verbose,$verbose)
$debug_real = pick($::cinder::debug,$debug)
oslo::log { 'cinder_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 cinder' do
rabbit_password => 'an_even_bigger_secret',
rabbit_host => '127.0.0.1',
debug => true,
verbose => true,
}
class { '::cinder::keystone::auth':
password => 'a_big_secret',

View File

@ -27,7 +27,6 @@ describe 'cinder::logging' do
:use_stderr => false,
:log_facility => 'LOG_USER',
:log_dir => '/var/log',
:verbose => true,
:debug => true,
}
end
@ -56,7 +55,6 @@ describe 'cinder::logging' do
is_expected.to contain_cinder_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/syslog_log_facility').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/log_dir').with(:value => '/var/log/cinder')
is_expected.to contain_cinder_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_cinder_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end
end
@ -67,7 +65,6 @@ describe 'cinder::logging' do
is_expected.to contain_cinder_config('DEFAULT/use_stderr').with(:value => 'false')
is_expected.to contain_cinder_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_USER')
is_expected.to contain_cinder_config('DEFAULT/log_dir').with(:value => '/var/log')
is_expected.to contain_cinder_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_cinder_config('DEFAULT/debug').with(:value => 'true')
end
end