Browse Source

Remove deprecated logging

The logging should be set in the logging class.

Change-Id: Ibf2d5ee85913aa45c5e47ec8d713f7d252c9c6b3
changes/11/620811/5
Tobias Urdin 4 years ago
parent
commit
d8f602d631
  1. 28
      manifests/init.pp
  2. 22
      manifests/logging.pp
  3. 5
      releasenotes/notes/remove-deprecated-logging-5e452cba26c6f67a.yaml
  4. 6
      spec/classes/aodh_init_spec.rb

28
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')

22
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::<myparam> first then aodh::logging::<myparam>.
$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,

5
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.

6
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',

Loading…
Cancel
Save