diff --git a/manifests/init.pp b/manifests/init.pp index 0d6cf1f8..bcdfc2bf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -176,6 +176,10 @@ # (Optional) Password for message broker authentication # Defaults to $::os_service_default. # +# [*use_syslog*] +# (Optional) Use syslog for logging. +# Defaults to undef +# # [*database_connection*] # Url used to connect to database. # (Optional) Defaults to undef. @@ -281,10 +285,6 @@ # (Optional) DEPRECATED. Should the daemons log verbose messages # Defaults to undef. # -# [*use_syslog*] -# (Optional) DEPRECATED. Use syslog for logging. -# Defaults to undef. -# # [*enable_v1_api*] # (Optional) DEPRECATED. Whether to enable the v1 API (true/false). # Defaults to undef. @@ -344,6 +344,7 @@ class cinder ( $cert_file = false, $key_file = false, $api_paste_config = '/etc/cinder/api-paste.ini', + $use_syslog = undef, $use_stderr = undef, $log_facility = undef, $log_dir = '/var/log/cinder', @@ -357,7 +358,6 @@ class cinder ( $purge_config = false, # DEPRECATED PARAMETERS $verbose = undef, - $use_syslog = undef, $enable_v1_api = undef, $enable_v2_api = undef, ) inherits cinder::params { @@ -378,10 +378,6 @@ class cinder ( 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.') - } - if $enable_v1_api { warning('enable_v1_api is deprecated, has no effect and will be removed in a future release') } diff --git a/manifests/logging.pp b/manifests/logging.pp index 92c69216..e45e7cee 100644 --- a/manifests/logging.pp +++ b/manifests/logging.pp @@ -7,6 +7,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 @@ -87,11 +91,8 @@ # (Optional) DEPRECATED. Should the daemons log verbose messages # Defaults to undef # -# [*use_syslog*] -# (Optional) DEPRECATED. Use syslog for logging. -# Defaults to undef -# class cinder::logging( + $use_syslog = $::os_service_default, $use_stderr = $::os_service_default, $log_facility = $::os_service_default, $log_dir = '/var/log/cinder', @@ -109,19 +110,15 @@ class cinder::logging( $log_date_format = $::os_service_default, # DEPRECATED PARAMETERS $verbose = undef, - $use_syslog = undef, ) { if $verbose { 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.') - } - # NOTE(spredzy): In order to keep backward compatibility we rely on the pick function # to use cinder:: if cinder::logging:: isn't specified. + $use_syslog_real = pick($::cinder::use_syslog,$use_syslog) $use_stderr_real = pick($::cinder::use_stderr,$use_stderr) $log_facility_real = pick($::cinder::log_facility,$log_facility) $log_dir_real = pick($::cinder::log_dir,$log_dir) @@ -129,6 +126,7 @@ class cinder::logging( oslo::log { 'cinder_config': debug => $debug_real, + use_syslog => $use_syslog_real, use_stderr => $use_stderr_real, log_dir => $log_dir_real, syslog_log_facility => $log_facility_real, diff --git a/releasenotes/notes/api_log_deprecations-81f5fd0239453011.yaml b/releasenotes/notes/api_log_deprecations-81f5fd0239453011.yaml index 3feecbf6..e822e9c3 100644 --- a/releasenotes/notes/api_log_deprecations-81f5fd0239453011.yaml +++ b/releasenotes/notes/api_log_deprecations-81f5fd0239453011.yaml @@ -1,6 +1,4 @@ --- deprecations: - - use_syslog in DEFAULT section was deprecated in Mitaka, this parameter - has no effect and will be removed in a future release. - enable_v1_api and enable_v2_api are deprecated (no parameters to subistitute) diff --git a/spec/classes/cinder_logging_spec.rb b/spec/classes/cinder_logging_spec.rb index e450247d..132aad97 100644 --- a/spec/classes/cinder_logging_spec.rb +++ b/spec/classes/cinder_logging_spec.rb @@ -23,6 +23,7 @@ describe 'cinder::logging' do :instance_format => '[instance: %(uuid)s] ', :instance_uuid_format => '[instance: %(uuid)s] ', :log_date_format => '%Y-%m-%d %H:%M:%S', + :use_syslog => false, :use_stderr => false, :log_facility => 'LOG_USER', :log_dir => '/var/log', @@ -50,6 +51,7 @@ describe 'cinder::logging' do shared_examples 'basic default logging settings' do it 'configures cinder logging settins with default values' do + is_expected.to contain_cinder_config('DEFAULT/use_syslog').with(:value => '') is_expected.to contain_cinder_config('DEFAULT/use_stderr').with(:value => '') is_expected.to contain_cinder_config('DEFAULT/syslog_log_facility').with(:value => '') is_expected.to contain_cinder_config('DEFAULT/log_dir').with(:value => '/var/log/cinder') @@ -59,6 +61,7 @@ describe 'cinder::logging' do shared_examples 'basic non-default logging settings' do it 'configures cinder logging settins with non-default values' do + is_expected.to contain_cinder_config('DEFAULT/use_syslog').with(:value => 'false') is_expected.to contain_cinder_config('DEFAULT/use_stderr').with(:value => 'false') is_expected.to contain_cinder_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_USER') is_expected.to contain_cinder_config('DEFAULT/log_dir').with(:value => '/var/log')