From d86a7757ce479dfc88bca47c4acc5694e6642b0e Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 22 Sep 2024 02:38:36 +0900 Subject: [PATCH] logging: Deprecate unused watch_log_file option Gnocchi no longer uses oslo.log so this functionality hasn't been available for some time. Change-Id: Ic388b6a23ccdbb7fae58592d6ac9bd8c239954ff --- manifests/logging.pp | 28 +++++++++++-------- ...ecate-watch_log_file-f29924b2bcb809f1.yaml | 5 ++++ spec/classes/gnocchi_logging_spec.rb | 19 ++++++------- 3 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 releasenotes/notes/deprecate-watch_log_file-f29924b2bcb809f1.yaml diff --git a/manifests/logging.pp b/manifests/logging.pp index f6aa0704..f9cb9795 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -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, } diff --git a/releasenotes/notes/deprecate-watch_log_file-f29924b2bcb809f1.yaml b/releasenotes/notes/deprecate-watch_log_file-f29924b2bcb809f1.yaml new file mode 100644 index 00000000..a6d61015 --- /dev/null +++ b/releasenotes/notes/deprecate-watch_log_file-f29924b2bcb809f1.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + The ``gnocchi::logging::watch_log_file`` parameter has been deprecated. + The parameter has no effect now. diff --git a/spec/classes/gnocchi_logging_spec.rb b/spec/classes/gnocchi_logging_spec.rb index 60b0f7bf..024deb6c 100644 --- a/spec/classes/gnocchi_logging_spec.rb +++ b/spec/classes/gnocchi_logging_spec.rb @@ -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 => '', :log_dir => '/var/log/gnocchi', :log_file => '', - :watch_log_file => '', :debug => '', ) 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