Deprecate verbose option in logging

Option "verbose" from group "DEFAULT" is deprecated for removal.
The parameter has no effect.
Deprecated verbose in all classes
Remove verbose in README
Remove verbose from tests.
If this option is not set explicitly, there is no such warning.

Change-Id: Iedbc3ea8824fdef8e1e5434d8be9463704c0579a
This commit is contained in:
Iury Gregory Melo Ferreira 2016-05-18 13:03:40 -03:00
parent 364cd54b74
commit 8246a80558
13 changed files with 71 additions and 54 deletions

View File

@ -46,12 +46,12 @@ trove is a combination of Puppet manifest and ruby code to delivery configuratio
The `trove_config` provider is a child of the ini_setting provider. It allows one to write an entry in the `/etc/trove/trove.conf` file.
```puppet
trove_config { 'DEFAULT/verbose' :
value => true,
trove_config { 'DEFAULT/backlog' :
value => 4096,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `backlog=4096` in the `[DEFAULT]` section.
##### name
@ -74,12 +74,12 @@ If value is equal to ensure_absent_val then the resource will behave as if `ensu
The `trove_conductor_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/trove/trove-conductor.conf` file.
```puppet
trove_conductor_config { 'DEFAULT/verbose' :
value => true,
trove_conductor_config { 'DEFAULT/auth_url' :
value => http://localhost:5000/v2.0,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `auth_url=http://localhost:5000/v2.0` in the `[DEFAULT]` section.
##### name
@ -102,12 +102,12 @@ If value is equal to ensure_absent_val then the resource will behave as if `ensu
The `trove_guestagent_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/trove/trove-guestagent.conf` file.
```puppet
trove_guestagent_config { 'DEFAULT/verbose' :
value => true,
trove_guestagent_config { 'DEFAULT/trove_auth_url' :
value => http://localhost:5000/v2.0,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `trove_auth_url=http://localhost:5000/v2.0` in the `[DEFAULT]` section.
##### name
@ -130,12 +130,12 @@ If value is equal to ensure_absent_val then the resource will behave as if `ensu
The `trove_taskmanager_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/trove/trove-taskmanager.conf` file.
```puppet
trove_taskmanager_config { 'DEFAULT/verbose' :
value => true,
trove_taskmanager_config { 'DEFAULT/network_driver' :
value => trove.network.neutron.NeutronDriver,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `network_driver=trove.network.neutron.NeutronDriver` in the `[DEFAULT]` section.
##### name

View File

@ -32,10 +32,6 @@
# [*keystone_password*]
# (required) Password used to authentication.
#
# [*verbose*]
# (optional) Rather to log the trove api service at verbose level.
# Defaults to undef
#
# [*debug*]
# (optional) Rather to log the trove api service at debug level.
# Defaults to undef
@ -158,9 +154,12 @@
# Authentication URL.
# Defaults to 'http://localhost:5000/v2.0'.
#
# [*verbose*]
# (optional) Deprecated. Rather to log the trove api service at verbose level.
# Defaults to undef
#
class trove::api(
$keystone_password,
$verbose = undef,
$debug = undef,
$log_file = undef,
$log_dir = undef,
@ -192,6 +191,7 @@ class trove::api(
$auth_url = 'http://localhost:5000/v2.0',
$auth_port = '35357',
$auth_protocol = 'http',
$verbose = undef,
) inherits trove {
include ::trove::deps
@ -200,6 +200,10 @@ class trove::api(
include ::trove::logging
include ::trove::params
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
# basic service config
trove_config {
'DEFAULT/bind_host': value => $bind_host;

View File

@ -16,10 +16,6 @@
# (optional) The state of the trove conductor package
# Defaults to 'present'
#
# [*verbose*]
# (optional) Rather to log the trove api service at verbose level.
# Default: false
#
# [*debug*]
# (optional) Rather to log the trove api service at debug level.
# Default: false
@ -62,11 +58,16 @@
# (optional) If False doesn't trace SQL requests.
# Default: $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (optional) Deprecated. Rather to log the trove api service at verbose level.
# Default: undef
class trove::conductor(
$enabled = true,
$manage_service = true,
$ensure_package = 'present',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$log_file = '/var/log/trove/trove-conductor.log',
$log_dir = '/var/log/trove',
@ -77,11 +78,17 @@ class trove::conductor(
$workers = $::processorcount,
$enable_profiler = $::os_service_default,
$trace_sqlalchemy = $::os_service_default,
# Deprecated
$verbose = undef,
) inherits trove {
include ::trove::deps
include ::trove::params
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
if $::trove::database_connection {
if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
require 'mysql::bindings'
@ -163,7 +170,6 @@ class trove::conductor(
oslo::log { 'trove_conductor_config':
debug => $debug,
verbose => $verbose,
log_file => $log_file,
log_dir => $log_dir,
use_syslog => $use_syslog,

View File

@ -16,10 +16,6 @@
# (optional) The state of the trove guest agent package
# Defaults to 'present'
#
# [*verbose*]
# (optional) Rather to log the trove guest agent service at verbose level.
# Default: false
#
# [*debug*]
# (optional) Rather to log the trove guest agent service at debug level.
# Default: false
@ -76,11 +72,17 @@
# guests need to talk to the rabbit cluster via
# a different port.
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (optional) Deprecated. Rather to log the trove
# guest agent service at verbose level.
# Default: undef
#
class trove::guestagent(
$enabled = true,
$manage_service = true,
$ensure_package = 'present',
$verbose = $::os_service_default,
$debug = $::os_service_default,
$log_file = '/var/log/trove/guestagent.log',
$log_dir = '/var/log/trove',
@ -92,11 +94,17 @@ class trove::guestagent(
$rabbit_hosts = $::trove::rabbit_hosts,
$rabbit_host = $::trove::rabbit_host,
$rabbit_port = $::trove::rabbit_port,
#Deprecated
$verbose = undef,
) inherits trove {
include ::trove::deps
include ::trove::params
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
# basic service config
trove_guestagent_config {
'DEFAULT/trove_auth_url': value => $auth_url;
@ -164,7 +172,6 @@ class trove::guestagent(
oslo::log { 'trove_guestagent_config':
debug => $debug,
verbose => $verbose,
log_file => $log_file,
log_dir => $log_dir,
use_syslog => $use_syslog,

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
@ -93,6 +89,12 @@
# (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 trove::logging(
$use_syslog = $::os_service_default,
@ -100,7 +102,6 @@ class trove::logging(
$log_facility = $::os_service_default,
$log_dir = '/var/log/trove',
$log_file = $::os_service_default,
$verbose = $::os_service_default,
$debug = $::os_service_default,
$logging_context_format_string = $::os_service_default,
$logging_default_format_string = $::os_service_default,
@ -113,6 +114,8 @@ class trove::logging(
$instance_format = $::os_service_default,
$instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default,
# Deprecated
$verbose = undef,
) {
include ::trove::deps
@ -124,12 +127,14 @@ class trove::logging(
$log_facility_real = pick($::trove::api::log_facility, $log_facility)
$log_dir_real = pick($::trove::api::log_dir, $log_dir)
$log_file_real = pick($::trove::api::log_file, $log_file)
$verbose_real = pick($::trove::api::verbose, $verbose)
$debug_real = pick($::trove::api::debug, $debug)
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
oslo::log { 'trove_config':
debug => $debug_real,
verbose => $verbose_real,
use_stderr => $use_stderr_real,
use_syslog => $use_syslog_real,
log_dir => $log_dir_real,

View File

@ -33,10 +33,6 @@
# (optional) The state of the trove taskmanager package
# Defaults to 'present'
#
# [*verbose*]
# (optional) Rather to log the trove api service at verbose level.
# Default: false
#
# [*debug*]
# (optional) Rather to log the trove api service at debug level.
# Default: false
@ -85,11 +81,14 @@
# (optional) Use template to provision trove guest agent configuration file.
# Defaults to true.
#
# [*verbose*]
# (optional) Deprecated. Rather to log the trove api service at verbose level.
# Default: undef
#
class trove::taskmanager(
$enabled = true,
$manage_service = true,
$debug = $::os_service_default,
$verbose = $::os_service_default,
$log_file = '/var/log/trove/trove-taskmanager.log',
$log_dir = '/var/log/trove',
$use_syslog = $::os_service_default,
@ -102,11 +101,16 @@ class trove::taskmanager(
$taskmanager_queue = 'taskmanager',
#DEPRECATED OPTIONS
$use_guestagent_template = true,
$verbose = undef,
) inherits trove {
include ::trove::deps
include ::trove::params
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
if $::trove::database_connection {
if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
require 'mysql::bindings'
@ -228,7 +232,6 @@ class trove::taskmanager(
oslo::log { 'trove_taskmanager_config':
debug => $debug,
verbose => $verbose,
log_file => $log_file,
log_dir => $log_dir,
use_syslog => $use_syslog,

View File

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

View File

@ -46,16 +46,13 @@ describe 'basic trove' do
identity_uri => 'http://127.0.0.1:35357/',
auth_uri => 'http://127.0.0.1:5000/',
debug => true,
verbose => true,
}
class { '::trove::client': }
class { '::trove::conductor':
debug => true,
verbose => true,
}
class { '::trove::taskmanager':
debug => true,
verbose => true,
}
class { '::trove::quota': }
EOS

View File

@ -26,7 +26,6 @@ describe 'trove::conductor' do
end
it 'configures trove-conductor with default parameters' do
is_expected.to contain_trove_conductor_config('DEFAULT/verbose').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')

View File

@ -27,7 +27,6 @@ describe 'trove::guestagent' do
end
it 'configures trove-guestagent with default parameters' do
is_expected.to contain_trove_guestagent_config('DEFAULT/verbose').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')

View File

@ -28,7 +28,6 @@ describe 'trove::logging' do
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/log/foo.log',
:verbose => true,
:debug => true,
}
end
@ -62,7 +61,6 @@ describe 'trove::logging' do
is_expected.to contain_trove_config('DEFAULT/syslog_log_facility').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/log_dir').with(:value => '/var/log/trove')
is_expected.to contain_trove_config('DEFAULT/log_file').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/verbose').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end
end
@ -74,7 +72,6 @@ describe 'trove::logging' do
is_expected.to contain_trove_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_trove_config('DEFAULT/log_dir').with(:value => '/var/log')
is_expected.to contain_trove_config('DEFAULT/log_file').with(:value => '/var/log/foo.log')
is_expected.to contain_trove_config('DEFAULT/verbose').with(:value => 'true')
is_expected.to contain_trove_config('DEFAULT/debug').with(:value => 'true')
end
end

View File

@ -51,7 +51,6 @@ describe 'trove::taskmanager' do
end
it 'configures trove-taskmanager with default parameters' do
is_expected.to contain_trove_taskmanager_config('DEFAULT/verbose').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')

View File

@ -17,9 +17,6 @@ control_exchange = <%= @control_exchange %>
# ========== Sample Logging Configuration ==========
# Show more verbose log output (sets INFO log level output)
verbose = <%= @verbose %>
# Show debugging output in logs (sets DEBUG log level output)
debug = <%= @debug %>