From ae2e2016d8e3431d4c58880f2ce99c5cacfe5a59 Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Thu, 29 Nov 2018 10:47:46 +0100 Subject: [PATCH] Remove deprecated logging Depends-On: https://review.openstack.org/#/c/624368/ Change-Id: I642eafca00422bebf12c4294b3c8985fffad724d --- manifests/init.pp | 44 +++++-------------- manifests/logging.pp | 20 +++------ ...e-deprecated-logging-f049f727e9bbcd47.yaml | 9 ++++ spec/classes/neutron_init_spec.rb | 38 ---------------- 4 files changed, 25 insertions(+), 86 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-logging-f049f727e9bbcd47.yaml diff --git a/manifests/init.pp b/manifests/init.pp index e3918f1b8..40adfa6c3 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -13,10 +13,6 @@ # (optional) The state of the package # Defaults to 'present' # -# [*debug*] -# (optional) Print debug messages in the logs -# Defaults to undef -# # [*bind_host*] # (optional) The IP/interface to bind to # Defaults to $::os_service_default @@ -276,28 +272,6 @@ # (optional) CA certificate file to use to verify connecting clients # Defaults to $::os_service_default # -# [*use_syslog*] -# (optional) Use syslog for logging -# Defaults to undef -# -# [*use_stderr*] -# (optional) Use stderr for logging -# Defaults to undef -# -# [*log_file*] -# (optional) Where to log -# Defaults to undef -# -# [*log_dir*] -# (optional) Directory where logs should be stored -# If set to $::os_service_default, it will not log to any directory -# Defaults to undef -# -# [*manage_logging*] -# (optional) Whether to manage olso.logging options -# If set to false, neutron::logging class should be evaluated -# Defaults to true. -# # [*state_path*] # (optional) Where to store state files. This directory must be writable # by the user executing the agent @@ -337,10 +311,16 @@ # (optional) Allow plugins that support it to create VLAN transparent networks # Defaults to $::os_service_default # +## DEPRECATED PARAMS +# +# [*manage_logging*] +# (optional) Whether to manage olso.logging options +# If set to false, neutron::logging class should be evaluated +# Defaults to undef. +# class neutron ( $enabled = true, $package_ensure = 'present', - $debug = undef, $bind_host = $::os_service_default, $bind_port = $::os_service_default, $core_plugin = 'ml2', @@ -396,11 +376,6 @@ class neutron ( $cert_file = $::os_service_default, $key_file = $::os_service_default, $ca_file = $::os_service_default, - $use_syslog = undef, - $use_stderr = undef, - $log_file = undef, - $log_dir = undef, - $manage_logging = true, $state_path = $::os_service_default, $lock_path = '$state_path/lock', $purge_config = false, @@ -409,12 +384,15 @@ class neutron ( $notification_transport_url = $::os_service_default, $max_allowed_address_pair = $::os_service_default, $vlan_transparent = $::os_service_default, + ## DEPRECATED PARAMS + $manage_logging = undef, ) { include ::neutron::deps include ::neutron::params + if $manage_logging { - include ::neutron::logging + warning('neutron::manage_logging is deprecated and has no effect, please use neutron::logging class') } if ! is_service_default($use_ssl) and ($use_ssl) { diff --git a/manifests/logging.pp b/manifests/logging.pp index 26d4b3197..cd4c1a71e 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -131,25 +131,15 @@ class neutron::logging ( include ::neutron::deps - $debug_real = pick($::neutron::debug,$debug) - $use_syslog_real = pick($::neutron::use_syslog,$use_syslog) - $use_stderr_real = pick($::neutron::use_stderr,$use_stderr) - $log_file_real = pick($::neutron::log_file,$log_file) - if $log_dir != '' { - $log_dir_real = pick($::neutron::log_dir,$log_dir) - } else { - $log_dir_real = $log_dir - } - oslo::log { 'neutron_config': - debug => $debug_real, - use_stderr => $use_stderr_real, - use_syslog => $use_syslog_real, + debug => $debug, + use_stderr => $use_stderr, + use_syslog => $use_syslog, use_json => $use_json, use_journal => $use_journal, syslog_log_facility => $syslog_log_facility, - log_file => $log_file_real, - log_dir => $log_dir_real, + log_file => $log_file, + log_dir => $log_dir, log_config_append => $log_config_append, log_date_format => $log_date_format, watch_log_file => $watch_log_file, diff --git a/releasenotes/notes/remove-deprecated-logging-f049f727e9bbcd47.yaml b/releasenotes/notes/remove-deprecated-logging-f049f727e9bbcd47.yaml new file mode 100644 index 000000000..ca448bad0 --- /dev/null +++ b/releasenotes/notes/remove-deprecated-logging-f049f727e9bbcd47.yaml @@ -0,0 +1,9 @@ +--- +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. +deprecations: + - | + neutron::manage_logging is deprecated and has no effect, please use the + neutron::logging class. diff --git a/spec/classes/neutron_init_spec.rb b/spec/classes/neutron_init_spec.rb index 8f439d508..3797c0f03 100644 --- a/spec/classes/neutron_init_spec.rb +++ b/spec/classes/neutron_init_spec.rb @@ -6,7 +6,6 @@ describe 'neutron' do :package_ensure => 'present', :core_plugin => 'ml2', :auth_strategy => 'keystone', - :log_dir => '/var/log/neutron', :purge_config => false, } end @@ -36,9 +35,6 @@ describe 'neutron' do it_behaves_like 'with SSL socket options set' it_behaves_like 'with SSL socket options set with wrong parameters' it_behaves_like 'with SSL socket options left by default' - it_behaves_like 'with syslog disabled' - it_behaves_like 'with syslog enabled' - it_behaves_like 'with log_file specified' it_behaves_like 'without service_plugins' it_behaves_like 'with service_plugins' it_behaves_like 'with host defined' @@ -208,15 +204,6 @@ describe 'neutron' do it { should raise_error(Puppet::Error, /The ca_file parameter requires that use_ssl to be set to true/) } end - shared_examples 'with syslog disabled' do - before do - params.merge!( - :use_syslog => false, - ) - end - it { should contain_neutron_config('DEFAULT/use_syslog').with_value(false) } - end - shared_examples 'with non-default kombu options' do before do params.merge!( @@ -293,31 +280,6 @@ describe 'neutron' do end - shared_examples 'with syslog enabled' do - before do - params.merge!( - :use_syslog => 'true' - ) - end - - it do - should contain_neutron_config('DEFAULT/use_syslog').with_value(true) - end - end - - shared_examples 'with log_file specified' do - before do - params.merge!( - :log_file => '/var/log/neutron/server.log', - :log_dir => '/tmp/log/neutron' - ) - end - it 'configures logging' do - should contain_neutron_config('DEFAULT/log_file').with_value(params[:log_file]) - should contain_neutron_config('DEFAULT/log_dir').with_value(params[:log_dir]) - end - end - shared_examples 'with state and lock paths set' do before { params.merge!( :state_path => 'state_path',