diff --git a/manifests/init.pp b/manifests/init.pp index 811dff324..9d07031e2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -250,6 +250,10 @@ # (optional) Path to the rootwrap configuration file to use for running commands as root # Defaults to '/etc/nova/rootwrap.conf' # +# [*use_syslog*] +# (optional) Use syslog for logging +# Defaults to undef +# # [*use_stderr*] # (optional) Use stderr for logging # Defaults to undef @@ -377,10 +381,6 @@ # (optional) Set log output to verbose output. # Defaults to undef # -# [*use_syslog*] -# (optional) Deprecated. Use syslog for logging -# Defaults to undef -# class nova( $ensure_package = 'present', $database_connection = undef, @@ -448,6 +448,7 @@ class nova( $key_file = false, $nova_public_key = undef, $nova_private_key = undef, + $use_syslog = undef, $use_stderr = undef, $log_facility = undef, $notification_driver = $::os_service_default, @@ -469,7 +470,6 @@ class nova( $purge_config = false, # DEPRECATED PARAMETERS $verbose = undef, - $use_syslog = undef, ) inherits nova::params { include ::nova::deps @@ -487,10 +487,6 @@ class nova( warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') } - if $use_syslog { - warning('use_syslog parameter is deprecated, has no effect and will be removed in a future release.') - } - if $use_ssl { if !$cert_file { fail('The cert_file parameter is required when use_ssl is set to true') diff --git a/manifests/logging.pp b/manifests/logging.pp index 76ee0b3da..5defa53c3 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -8,6 +8,10 @@ # (Optional) Should the daemons log debug messages # Defaults to $::os_service_default # +# [*use_syslog*] +# (Optional) Use syslog for logging. +# Defaults to $::os_service_default +# # [*use_stderr*] # (optional) Use stderr for logging # Defaults to $::os_service_default @@ -88,11 +92,8 @@ # DEPRECATED: Parameter has no effect # Defaults to undef # -# [*use_syslog*] -# (Optional) DEPRECATED. Use syslog for logging. -# Defaults to undef -# class nova::logging( + $use_syslog = $::os_service_default, $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/nova', @@ -110,13 +111,13 @@ class nova::logging( $log_date_format = $::os_service_default, # DEPRECATED PARAMETERS $verbose = undef, - $use_syslog = undef, ) { include ::nova::deps # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function # to use nova:: first then nova::logging::. + $use_syslog_real = pick($::nova::use_syslog,$use_syslog) $use_stderr_real = pick($::nova::use_stderr,$use_stderr) $log_facility_real = pick($::nova::log_facility,$log_facility) $log_dir_real = pick($::nova::log_dir,$log_dir) @@ -126,13 +127,10 @@ class nova::logging( warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') } - if $use_syslog { - warning('use_syslog is deprecated, has no effect and will be removed in a future release.') - } - oslo::log { 'nova_config': debug => $debug_real, use_stderr => $use_stderr_real, + use_syslog => $use_syslog_real, log_dir => $log_dir_real, syslog_log_facility => $log_facility_real, logging_context_format_string => $logging_context_format_string, diff --git a/releasenotes/notes/newton_deprecations2-397e84f01b7a283e.yaml b/releasenotes/notes/newton_deprecations2-397e84f01b7a283e.yaml index 030c7c9a2..0f48bb1f2 100644 --- a/releasenotes/notes/newton_deprecations2-397e84f01b7a283e.yaml +++ b/releasenotes/notes/newton_deprecations2-397e84f01b7a283e.yaml @@ -3,6 +3,6 @@ deprecations: - libvirt remove_unused_kernels, cells manager are deprecated. They have no effect and will be removed in a future release. - - DEFAULT use_syslog/network_device_mtu/compute_manager + - DEFAULT network_device_mtu/compute_manager are deprecated. Only compute_manager has effect, because Ironic use. They will be removed in a future release. diff --git a/spec/classes/nova_logging_spec.rb b/spec/classes/nova_logging_spec.rb index f53dfea02..e53f7ad69 100644 --- a/spec/classes/nova_logging_spec.rb +++ b/spec/classes/nova_logging_spec.rb @@ -23,6 +23,7 @@ describe 'nova::logging' do :instance_format => '[instance: %(uuid)s] ', :instance_uuid_format => '[instance: %(uuid)s] ', :log_date_format => '%Y-%m-%d %H:%M:%S', + :use_syslog => true, :use_stderr => false, :log_facility => 'LOG_FOO', :log_dir => '/var/log', @@ -54,6 +55,7 @@ describe 'nova::logging' do shared_examples 'basic default logging settings' do it 'configures nova logging settins with default values' do + is_expected.to contain_nova_config('DEFAULT/use_syslog').with(:value => '') is_expected.to contain_nova_config('DEFAULT/use_stderr').with(:value => '') is_expected.to contain_nova_config('DEFAULT/log_dir').with(:value => '/var/log/nova') is_expected.to contain_nova_config('DEFAULT/debug').with(:value => '') @@ -62,6 +64,7 @@ describe 'nova::logging' do shared_examples 'basic non-default logging settings' do it 'configures nova logging settins with non-default values' do + is_expected.to contain_nova_config('DEFAULT/use_syslog').with(:value => 'true') is_expected.to contain_nova_config('DEFAULT/use_stderr').with(:value => 'false') is_expected.to contain_nova_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO') is_expected.to contain_nova_config('DEFAULT/log_dir').with(:value => '/var/log')