Merge "logging: Deprecate unused watch_log_file option"

This commit is contained in:
Zuul 2024-09-24 08:29:33 +00:00 committed by Gerrit Code Review
commit ae0a30f890
3 changed files with 30 additions and 22 deletions

View File

@ -38,24 +38,31 @@
# (Optional) File where logs should be stored.
# Defaults to $facts['os_service_default']
#
# DEPRECATED PARAMETERS
#
# [*watch_log_file*]
# (Optional) Uses logging handler designed to watch file system (boolean value).
# Defaults to $facts['os_service_default']
# Defaults to undef
#
class gnocchi::logging(
$use_syslog = $facts['os_service_default'],
$use_json = $facts['os_service_default'],
$use_journal = $facts['os_service_default'],
$use_stderr = $facts['os_service_default'],
$log_facility = $facts['os_service_default'],
$log_dir = '/var/log/gnocchi',
$log_file = $facts['os_service_default'],
$watch_log_file = $facts['os_service_default'],
$debug = $facts['os_service_default'],
$use_syslog = $facts['os_service_default'],
$use_json = $facts['os_service_default'],
$use_journal = $facts['os_service_default'],
$use_stderr = $facts['os_service_default'],
$log_facility = $facts['os_service_default'],
$log_dir = '/var/log/gnocchi',
$log_file = $facts['os_service_default'],
$debug = $facts['os_service_default'],
# DEPRECATED PARAMETERS
$watch_log_file = undef,
) {
include gnocchi::deps
if $watch_log_file {
warning('The watch_log_file parameter has been deprecated and has no effect.')
}
oslo::log { 'gnocchi_config':
debug => $debug,
use_syslog => $use_syslog,
@ -64,7 +71,6 @@ class gnocchi::logging(
use_stderr => $use_stderr,
log_dir => $log_dir,
log_file => $log_file,
watch_log_file => $watch_log_file,
syslog_log_facility => $log_facility,
}

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
The ``gnocchi::logging::watch_log_file`` parameter has been deprecated.
The parameter has no effect now.

View File

@ -9,15 +9,14 @@ describe 'gnocchi::logging' do
let :log_params do
{
:use_syslog => true,
:use_json => true,
:use_journal => true,
:use_stderr => false,
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/log/gnocchi/gnocchi.log',
:watch_log_file => true,
:debug => true,
:use_syslog => true,
:use_json => true,
:use_journal => true,
:use_stderr => false,
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/log/gnocchi/gnocchi.log',
:debug => true,
}
end
@ -44,7 +43,6 @@ describe 'gnocchi::logging' do
:syslog_log_facility => '<SERVICE DEFAULT>',
:log_dir => '/var/log/gnocchi',
:log_file => '<SERVICE DEFAULT>',
:watch_log_file => '<SERVICE DEFAULT>',
:debug => '<SERVICE DEFAULT>',
)
end
@ -60,7 +58,6 @@ describe 'gnocchi::logging' do
:syslog_log_facility => 'LOG_FOO',
:log_dir => '/var/log',
:log_file => '/var/log/gnocchi/gnocchi.log',
:watch_log_file => true,
:debug => true,
)
end