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. 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 ```puppet
trove_config { 'DEFAULT/verbose' : trove_config { 'DEFAULT/backlog' :
value => true, value => 4096,
} }
``` ```
This will write `verbose=true` in the `[DEFAULT]` section. This will write `backlog=4096` in the `[DEFAULT]` section.
##### name ##### 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. 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 ```puppet
trove_conductor_config { 'DEFAULT/verbose' : trove_conductor_config { 'DEFAULT/auth_url' :
value => true, 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 ##### 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. 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 ```puppet
trove_guestagent_config { 'DEFAULT/verbose' : trove_guestagent_config { 'DEFAULT/trove_auth_url' :
value => true, 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 ##### 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. 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 ```puppet
trove_taskmanager_config { 'DEFAULT/verbose' : trove_taskmanager_config { 'DEFAULT/network_driver' :
value => true, 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 ##### name

View File

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

View File

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

View File

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

View File

@ -4,10 +4,6 @@
# #
# == parameters # == parameters
# #
# [*verbose*]
# (Optional) Should the daemons log verbose messages
# Defaults to $::os_service_default
#
# [*debug*] # [*debug*]
# (Optional) Should the daemons log debug messages # (Optional) Should the daemons log debug messages
# Defaults to $::os_service_default # Defaults to $::os_service_default
@ -93,6 +89,12 @@
# (optional) Format string for %%(asctime)s in log records. # (optional) Format string for %%(asctime)s in log records.
# Defaults to $::os_service_default # Defaults to $::os_service_default
# Example: 'Y-%m-%d %H:%M:%S' # Example: 'Y-%m-%d %H:%M:%S'
#
# DEPRECATED PARAMETERS
#
# [*verbose*]
# (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef.
class trove::logging( class trove::logging(
$use_syslog = $::os_service_default, $use_syslog = $::os_service_default,
@ -100,7 +102,6 @@ class trove::logging(
$log_facility = $::os_service_default, $log_facility = $::os_service_default,
$log_dir = '/var/log/trove', $log_dir = '/var/log/trove',
$log_file = $::os_service_default, $log_file = $::os_service_default,
$verbose = $::os_service_default,
$debug = $::os_service_default, $debug = $::os_service_default,
$logging_context_format_string = $::os_service_default, $logging_context_format_string = $::os_service_default,
$logging_default_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_format = $::os_service_default,
$instance_uuid_format = $::os_service_default, $instance_uuid_format = $::os_service_default,
$log_date_format = $::os_service_default, $log_date_format = $::os_service_default,
# Deprecated
$verbose = undef,
) { ) {
include ::trove::deps include ::trove::deps
@ -124,12 +127,14 @@ class trove::logging(
$log_facility_real = pick($::trove::api::log_facility, $log_facility) $log_facility_real = pick($::trove::api::log_facility, $log_facility)
$log_dir_real = pick($::trove::api::log_dir, $log_dir) $log_dir_real = pick($::trove::api::log_dir, $log_dir)
$log_file_real = pick($::trove::api::log_file, $log_file) $log_file_real = pick($::trove::api::log_file, $log_file)
$verbose_real = pick($::trove::api::verbose, $verbose)
$debug_real = pick($::trove::api::debug, $debug) $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': oslo::log { 'trove_config':
debug => $debug_real, debug => $debug_real,
verbose => $verbose_real,
use_stderr => $use_stderr_real, use_stderr => $use_stderr_real,
use_syslog => $use_syslog_real, use_syslog => $use_syslog_real,
log_dir => $log_dir_real, log_dir => $log_dir_real,

View File

@ -33,10 +33,6 @@
# (optional) The state of the trove taskmanager package # (optional) The state of the trove taskmanager package
# Defaults to 'present' # Defaults to 'present'
# #
# [*verbose*]
# (optional) Rather to log the trove api service at verbose level.
# Default: false
#
# [*debug*] # [*debug*]
# (optional) Rather to log the trove api service at debug level. # (optional) Rather to log the trove api service at debug level.
# Default: false # Default: false
@ -85,11 +81,14 @@
# (optional) Use template to provision trove guest agent configuration file. # (optional) Use template to provision trove guest agent configuration file.
# Defaults to true. # Defaults to true.
# #
# [*verbose*]
# (optional) Deprecated. Rather to log the trove api service at verbose level.
# Default: undef
#
class trove::taskmanager( class trove::taskmanager(
$enabled = true, $enabled = true,
$manage_service = true, $manage_service = true,
$debug = $::os_service_default, $debug = $::os_service_default,
$verbose = $::os_service_default,
$log_file = '/var/log/trove/trove-taskmanager.log', $log_file = '/var/log/trove/trove-taskmanager.log',
$log_dir = '/var/log/trove', $log_dir = '/var/log/trove',
$use_syslog = $::os_service_default, $use_syslog = $::os_service_default,
@ -102,11 +101,16 @@ class trove::taskmanager(
$taskmanager_queue = 'taskmanager', $taskmanager_queue = 'taskmanager',
#DEPRECATED OPTIONS #DEPRECATED OPTIONS
$use_guestagent_template = true, $use_guestagent_template = true,
$verbose = undef,
) inherits trove { ) inherits trove {
include ::trove::deps include ::trove::deps
include ::trove::params 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 {
if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) { if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
require 'mysql::bindings' require 'mysql::bindings'
@ -228,7 +232,6 @@ class trove::taskmanager(
oslo::log { 'trove_taskmanager_config': oslo::log { 'trove_taskmanager_config':
debug => $debug, debug => $debug,
verbose => $verbose,
log_file => $log_file, log_file => $log_file,
log_dir => $log_dir, log_dir => $log_dir,
use_syslog => $use_syslog, 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/', identity_uri => 'http://127.0.0.1:35357/',
auth_uri => 'http://127.0.0.1:5000/', auth_uri => 'http://127.0.0.1:5000/',
debug => true, debug => true,
verbose => true,
} }
class { '::trove::client': } class { '::trove::client': }
class { '::trove::conductor': class { '::trove::conductor':
debug => true, debug => true,
verbose => true,
} }
class { '::trove::taskmanager': class { '::trove::taskmanager':
debug => true, debug => true,
verbose => true,
} }
class { '::trove::quota': } class { '::trove::quota': }
EOS EOS

View File

@ -26,7 +26,6 @@ describe 'trove::conductor' do
end end
it 'configures trove-conductor with default parameters' do 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/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/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/syslog_log_facility').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 end
it 'configures trove-guestagent with default parameters' do 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/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/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/syslog_log_facility').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_facility => 'LOG_FOO',
:log_dir => '/var/log', :log_dir => '/var/log',
:log_file => '/var/log/foo.log', :log_file => '/var/log/foo.log',
:verbose => true,
:debug => true, :debug => true,
} }
end 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/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_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/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>') is_expected.to contain_trove_config('DEFAULT/debug').with(:value => '<SERVICE DEFAULT>')
end end
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/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_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/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') is_expected.to contain_trove_config('DEFAULT/debug').with(:value => 'true')
end end
end end

View File

@ -51,7 +51,6 @@ describe 'trove::taskmanager' do
end end
it 'configures trove-taskmanager with default parameters' do 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/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/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/syslog_log_facility').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 ========== # ========== 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) # Show debugging output in logs (sets DEBUG log level output)
debug = <%= @debug %> debug = <%= @debug %>