From d8f602d631010e68d00b82722d9f27c654e23acf Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Thu, 29 Nov 2018 09:52:19 +0100 Subject: [PATCH] Remove deprecated logging The logging should be set in the logging class. Change-Id: Ibf2d5ee85913aa45c5e47ec8d713f7d252c9c6b3 --- manifests/init.pp | 28 ------------------- manifests/logging.pp | 22 ++++----------- ...e-deprecated-logging-5e452cba26c6f67a.yaml | 5 ++++ spec/classes/aodh_init_spec.rb | 6 ---- 4 files changed, 10 insertions(+), 51 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-logging-5e452cba26c6f67a.yaml diff --git a/manifests/init.pp b/manifests/init.pp index 6222c5c1..8a4b74a0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -155,28 +155,6 @@ # (Optional) Password for message broker authentication # Defaults to $::os_service_default. # -# [*log_dir*] -# (optional) Directory where logs should be stored. -# If set to boolean false or the $::os_service_default, it will not log to -# any directory. -# Defaults to undef. -# -# [*debug*] -# (optional) Set log output to debug output. -# Defaults to undef -# -# [*use_syslog*] -# (optional) Use syslog for logging -# Defaults to undef -# -# [*use_stderr*] -# (optional) Use stderr for logging -# Defaults to undef -# -# [*log_facility*] -# (optional) Syslog facility to receive log lines. -# Defaults to undef -# # [*notification_transport_url*] # (optional) A URL representing the messaging driver to use for notifications # and its full configuration. Transport URLs take the form: @@ -269,11 +247,6 @@ class aodh ( $amqp_sasl_config_name = $::os_service_default, $amqp_username = $::os_service_default, $amqp_password = $::os_service_default, - $debug = undef, - $use_syslog = undef, - $use_stderr = undef, - $log_facility = undef, - $log_dir = undef, $notification_transport_url = $::os_service_default, $notification_driver = $::os_service_default, $notification_topics = $::os_service_default, @@ -292,7 +265,6 @@ class aodh ( include ::aodh::deps include ::aodh::db - include ::aodh::logging if $gnocchi_url { warning('gnocchi_url has no effect as of Newton and will be removed in a future release') diff --git a/manifests/logging.pp b/manifests/logging.pp index 27aa3258..d7c82090 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -117,26 +117,14 @@ class aodh::logging( include ::aodh::deps - # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function - # to use aodh:: first then aodh::logging::. - $use_syslog_real = pick($::aodh::use_syslog,$use_syslog) - $use_stderr_real = pick($::aodh::use_stderr,$use_stderr) - $log_facility_real = pick($::aodh::log_facility,$log_facility) - if $log_dir != '' { - $log_dir_real = pick($::aodh::log_dir,$log_dir) - } else { - $log_dir_real = $log_dir - } - $debug_real = pick($::aodh::debug,$debug) - oslo::log { 'aodh_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-5e452cba26c6f67a.yaml b/releasenotes/notes/remove-deprecated-logging-5e452cba26c6f67a.yaml new file mode 100644 index 00000000..83979a5c --- /dev/null +++ b/releasenotes/notes/remove-deprecated-logging-5e452cba26c6f67a.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/classes/aodh_init_spec.rb b/spec/classes/aodh_init_spec.rb index 92189f72..c553bdc9 100644 --- a/spec/classes/aodh_init_spec.rb +++ b/spec/classes/aodh_init_spec.rb @@ -6,17 +6,12 @@ describe 'aodh' do it { is_expected.to contain_class('aodh::deps') } it { is_expected.to contain_class('aodh::db') } - it { is_expected.to contain_class('aodh::logging') } context 'with default parameters' do let :params do { :purge_config => false } end - it 'contains the logging class' do - is_expected.to contain_class('aodh::logging') - end - it 'installs packages' do is_expected.to contain_package('aodh').with( :name => platform_params[:aodh_common_package], @@ -48,7 +43,6 @@ describe 'aodh' do context 'with overridden parameters' do let :params do { - :debug => true, :default_transport_url => 'rabbit://rabbit_user:password@localhost:5673', :rabbit_ha_queues => 'undef', :rabbit_heartbeat_timeout_threshold => '60',