Browse Source

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: I67f69fb01e748f64015774d58ac7a8057e79a547
changes/27/317827/1
Iury Gregory Melo Ferreira 6 years ago
parent
commit
8febdc37c2
  1. 6
      README.md
  2. 12
      manifests/init.pp
  3. 19
      manifests/logging.pp
  4. 4
      releasenotes/notes/verbose-deprecation-49b680241facb7c3.yaml
  5. 1
      spec/classes/ceilometer_init_spec.rb
  6. 3
      spec/classes/ceilometer_logging_spec.rb

6
README.md

@ -78,12 +78,12 @@ extra functionality through types and providers.
The `ceilometer_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/ceilometer/ceilometer.conf` file.
```puppet
ceilometer_config { 'DEFAULT/verbose' :
value => true,
ceilometer_config { 'DEFAULT/http_timeout' :
value => 600,
}
```
This will write `verbose=true` in the `[DEFAULT]` section.
This will write `http_timeout=600` in the `[DEFAULT]` section.
##### name

12
manifests/init.pp

@ -39,10 +39,6 @@
# If set to boolean false, it will not log to any directory.
# Defaults to undef.
#
# [*verbose*]
# (Optional) should the daemons log verbose messages.
# Defaults to undef.
#
# [*use_syslog*]
# (Optional) Use syslog for logging
# Defaults to undef.
@ -216,6 +212,9 @@
#
# [*alarm_history_time_to_live*]
#
# [*verbose*]
# (Optional) Deprecated. should the daemons log verbose messages.
# Defaults to undef.
class ceilometer(
$http_timeout = '600',
$event_time_to_live = '-1',
@ -225,7 +224,6 @@ class ceilometer(
$package_ensure = 'present',
$debug = undef,
$log_dir = undef,
$verbose = undef,
$use_syslog = undef,
$use_stderr = undef,
$log_facility = undef,
@ -267,11 +265,15 @@ class ceilometer(
# DEPRECATED PARAMETERS
$alarm_history_time_to_live = undef,
$metering_secret = undef,
$verbose = undef,
) {
include ::ceilometer::logging
include ::ceilometer::params
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
# Cleanup in Ocata.
if $telemetry_secret {
validate_string($telemetry_secret)

19
manifests/logging.pp

@ -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.
@ -89,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 ceilometer::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/ceilometer',
$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 ceilometer::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 +118,14 @@ class ceilometer::logging(
$use_stderr_real = pick($::ceilometer::use_stderr,$use_stderr)
$log_facility_real = pick($::ceilometer::log_facility,$log_facility)
$log_dir_real = pick($::ceilometer::log_dir,$log_dir)
$verbose_real = pick($::ceilometer::verbose,$verbose)
$debug_real = pick($::ceilometer::debug,$debug)
if $verbose {
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.')
}
oslo::log { 'ceilometer_config':
debug => $debug_real,
verbose => $verbose_real,
use_stderr => $use_stderr_real,
use_syslog => $use_syslog_real,
log_dir => $log_dir_real,

4
releasenotes/notes/verbose-deprecation-49b680241facb7c3.yaml

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

1
spec/classes/ceilometer_init_spec.rb

@ -11,7 +11,6 @@ describe 'ceilometer' do
:package_ensure => 'present',
:debug => 'False',
:log_dir => '/var/log/ceilometer',
:verbose => 'False',
:use_stderr => 'True',
}
end

3
spec/classes/ceilometer_logging_spec.rb

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

Loading…
Cancel
Save