From b2af5bd3c1fbc5f757351b8c442971b84fa62f51 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Thu, 29 Nov 2018 10:38:39 +0100 Subject: [PATCH] Remove deprecated logging Change-Id: I10d9961652f9e966f2730cb25e496fa03a35446f --- manifests/init.pp | 27 ------------------- manifests/logging.pp | 22 ++++----------- ...e-deprecated-logging-1f9da83a74e11491.yaml | 5 ++++ spec/acceptance/basic_manila_spec.rb | 4 ++- spec/classes/manila_init_spec.rb | 5 ---- 5 files changed, 13 insertions(+), 50 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-logging-1f9da83a74e11491.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 08d1df99..8fc58202 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -105,23 +105,6 @@ # (optional) Use durable queues in amqp. # Defaults to $::os_service_default. # -# [*use_stderr*] -# (optional) Use stderr for logging -# Defaults to undef -# -# [*use_syslog*] -# Use syslog for logging. -# (Optional) Defaults to false. -# -# [*log_facility*] -# Syslog facility to receive log lines. -# (Optional) Defaults to LOG_USER. -# -# [*log_dir*] -# (optional) Directory where logs should be stored. -# If set to $::os_service_default, it will not log to any directory. -# Defaults to '/var/log/manila' -# # [*use_ssl*] # (optional) Enable SSL on the API server # Defaults to false, not set @@ -138,10 +121,6 @@ # (optional) CA certificate file to use to verify connecting clients # Defaults to false, not set_ # -# [*debug*] -# (Optional) Should the daemons log debug messages -# Defaults to false -# # [*api_paste_config*] # (Optional) Allow Configuration of /etc/manila/api-paste.ini. # @@ -259,11 +238,6 @@ class manila ( $cert_file = false, $key_file = false, $api_paste_config = '/etc/manila/api-paste.ini', - $use_stderr = undef, - $use_syslog = undef, - $log_facility = undef, - $log_dir = undef, - $debug = undef, $storage_availability_zone = 'nova', $rootwrap_config = '/etc/manila/rootwrap.conf', $state_path = '/var/lib/manila', @@ -290,7 +264,6 @@ class manila ( include ::manila::deps include ::manila::db - include ::manila::logging include ::manila::params if $use_ssl { diff --git a/manifests/logging.pp b/manifests/logging.pp index b79d7307..985e48da 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -116,26 +116,14 @@ class manila::logging( include ::manila::deps - # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function - # to use manila:: first then manila::logging::. - $use_syslog_real = pick($::manila::use_syslog,$use_syslog) - $use_stderr_real = pick($::manila::use_stderr,$use_stderr) - $log_facility_real = pick($::manila::log_facility,$log_facility) - if $log_dir != '' { - $log_dir_real = pick($::manila::log_dir,$log_dir) - } else { - $log_dir_real = $log_dir - } - $debug_real = pick($::manila::debug,$debug) - oslo::log { 'manila_config': - debug => $debug_real, - use_syslog => $use_syslog_real, + debug => $debug, + use_syslog => $use_syslog, use_json => $use_json, use_journal => $use_journal, - use_stderr => $use_stderr_real, - log_dir => $log_dir_real, - syslog_log_facility => $log_facility_real, + use_stderr => $use_stderr, + log_dir => $log_dir, + syslog_log_facility => $log_facility, logging_context_format_string => $logging_context_format_string, logging_default_format_string => $logging_default_format_string, logging_debug_format_suffix => $logging_debug_format_suffix, diff --git a/releasenotes/notes/remove-deprecated-logging-1f9da83a74e11491.yaml b/releasenotes/notes/remove-deprecated-logging-1f9da83a74e11491.yaml new file mode 100644 index 00000000..83979a5c --- /dev/null +++ b/releasenotes/notes/remove-deprecated-logging-1f9da83a74e11491.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - | + The deprecated parameters use_syslog, use_stderr, log_facility, log_dir and + debug in the init class is now removed. Please set them in the logging class. diff --git a/spec/acceptance/basic_manila_spec.rb b/spec/acceptance/basic_manila_spec.rb index f86417f3..cd05457d 100644 --- a/spec/acceptance/basic_manila_spec.rb +++ b/spec/acceptance/basic_manila_spec.rb @@ -28,10 +28,12 @@ describe 'basic manila' do } # Manila resources + class { '::manila::logging': + debug => true, + } class { '::manila': default_transport_url => 'rabbit://manila:an_even_bigger_secret@127.0.0.1:5672/', sql_connection => 'mysql+pymysql://manila:a_big_secret@127.0.0.1/manila?charset=utf8', - debug => true, } class { '::manila::db::mysql': password => 'a_big_secret', diff --git a/spec/classes/manila_init_spec.rb b/spec/classes/manila_init_spec.rb index 9421842c..5e3d187c 100644 --- a/spec/classes/manila_init_spec.rb +++ b/spec/classes/manila_init_spec.rb @@ -13,7 +13,6 @@ describe 'manila' do req_params end - it { is_expected.to contain_class('manila::logging') } it { is_expected.to contain_class('manila::params') } it 'passes purge to resource' do @@ -50,9 +49,6 @@ describe 'manila' do is_expected.to contain_manila_config('oslo_messaging_rabbit/kombu_failover_strategy').with( :value => '' ) - is_expected.to contain_manila_config('DEFAULT/debug').with( - :value => '' - ) is_expected.to contain_manila_config('DEFAULT/storage_availability_zone').with( :value => 'nova' ) @@ -74,7 +70,6 @@ describe 'manila' do is_expected.to contain_oslo__messaging__rabbit('manila_config').with( :rabbit_use_ssl => '', ) - is_expected.to contain_oslo__log('manila_config').with(:log_dir => '/var/log/manila') end end