Revert "Deprecate use_syslog"

This option is not deprecated and still actual

This reverts commit 75561b627f.

Change-Id: I6a017cc489ac195d02ef1f6b3e9b35e5c06af283
This commit is contained in:
Denis Egorenko
2016-05-31 13:39:34 +00:00
parent 75561b627f
commit 0611bb61f2
4 changed files with 20 additions and 21 deletions

View File

@@ -12,6 +12,10 @@
# (Optional) Should the daemons log debug messages # (Optional) Should the daemons log debug messages
# Defaults to undef. # Defaults to undef.
# #
# [*use_syslog*]
# Use syslog for logging.
# (Optional) Defaults to undef.
#
# [*use_stderr*] # [*use_stderr*]
# (optional) Use stderr for logging # (optional) Use stderr for logging
# Defaults to undef # Defaults to undef
@@ -315,13 +319,10 @@
# (Optional) Deprecated. Should the daemons log verbose messages # (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef. # Defaults to undef.
# #
# [*use_syslog*]
# DEPRECATED. Use syslog for logging.
# (Optional) Defaults to undef.
#
class sahara( class sahara(
$package_ensure = 'present', $package_ensure = 'present',
$debug = undef, $debug = undef,
$use_syslog = undef,
$use_stderr = undef, $use_stderr = undef,
$log_facility = undef, $log_facility = undef,
$log_dir = undef, $log_dir = undef,
@@ -393,7 +394,6 @@ class sahara(
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
$zeromq_port = undef, $zeromq_port = undef,
$verbose = undef, $verbose = undef,
$use_syslog = undef,
) { ) {
include ::sahara::params include ::sahara::params
include ::sahara::logging include ::sahara::logging
@@ -404,10 +404,6 @@ class sahara(
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') 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')
}
package { 'sahara-common': package { 'sahara-common':
ensure => $package_ensure, ensure => $package_ensure,
name => $::sahara::params::common_package_name, name => $::sahara::params::common_package_name,

View File

@@ -8,6 +8,10 @@
# (Optional) Should the daemons log debug messages # (Optional) Should the daemons log debug messages
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
# #
# [*use_syslog*]
# Use syslog for logging.
# (Optional) Defaults to $::os_service_default.
#
# [*use_stderr*] # [*use_stderr*]
# (optional) Use stderr for logging # (optional) Use stderr for logging
# Defaults to $::os_service_default. # Defaults to $::os_service_default.
@@ -87,12 +91,9 @@
# (Optional) Deprecated. Should the daemons log verbose messages # (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef # Defaults to undef
# #
# [*use_syslog*]
# (Optional) Deprecated Use syslog for logging.
# Defaults to undef
#
class sahara::logging( class sahara::logging(
$debug = $::os_service_default, $debug = $::os_service_default,
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default, $use_stderr = $::os_service_default,
$log_facility = $::os_service_default, $log_facility = $::os_service_default,
$log_dir = '/var/log/sahara', $log_dir = '/var/log/sahara',
@@ -109,11 +110,11 @@ class sahara::logging(
$log_date_format = $::os_service_default, $log_date_format = $::os_service_default,
# Deprecated # Deprecated
$verbose = undef, $verbose = undef,
$use_syslog = undef,
) { ) {
# NOTE(degorenko): In order to keep backward compatibility we rely on the pick function # NOTE(degorenko): In order to keep backward compatibility we rely on the pick function
# to use sahara::<myparam> if sahara::logging::<myparam> isn't specified. # to use sahara::<myparam> if sahara::logging::<myparam> isn't specified.
$use_syslog_real = pick($::sahara::use_syslog, $use_syslog)
$use_stderr_real = pick($::sahara::use_stderr, $use_stderr) $use_stderr_real = pick($::sahara::use_stderr, $use_stderr)
$log_facility_real = pick($::sahara::log_facility, $log_facility) $log_facility_real = pick($::sahara::log_facility, $log_facility)
$log_dir_real = pick($::sahara::log_dir, $log_dir) $log_dir_real = pick($::sahara::log_dir, $log_dir)
@@ -123,11 +124,9 @@ class sahara::logging(
warning('verbose is deprecated, has no effect and will be removed after Newton cycle.') 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 { 'sahara_config': oslo::log { 'sahara_config':
debug => $debug_real, debug => $debug_real,
use_syslog => $use_syslog_real,
use_stderr => $use_stderr_real, use_stderr => $use_stderr_real,
log_dir => $log_dir_real, log_dir => $log_dir_real,
syslog_log_facility => $log_facility_real, syslog_log_facility => $log_facility_real,

View File

@@ -1,4 +0,0 @@
---
deprecations:
- use_syslog in DEFAULT section was deprecated in Mitaka, this parameter
has no effect and will be removed in a future release.

View File

@@ -10,6 +10,7 @@ describe 'sahara::logging' do
let :log_params do let :log_params do
{ {
:debug => 'true', :debug => 'true',
:use_syslog => 'true',
:use_stderr => 'false', :use_stderr => 'false',
:log_facility => 'LOG_LOCAL0', :log_facility => 'LOG_LOCAL0',
:log_dir => '/tmp/sahara', :log_dir => '/tmp/sahara',
@@ -59,11 +60,17 @@ describe 'sahara::logging' do
shared_examples_for 'basic logging options defaults' do shared_examples_for 'basic logging options defaults' do
context 'with defaults' do context 'with defaults' do
it { is_expected.to contain_sahara_config('DEFAULT/use_stderr').with_value('<SERVICE DEFAULT>') } it { is_expected.to contain_sahara_config('DEFAULT/use_stderr').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_sahara_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_sahara_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>') } it { is_expected.to contain_sahara_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_sahara_config('DEFAULT/log_dir').with_value('/var/log/sahara') } it { is_expected.to contain_sahara_config('DEFAULT/log_dir').with_value('/var/log/sahara') }
end end
context 'with syslog enabled and default log facility' do context 'with syslog enabled and default log facility' do
let :params do
{ :use_syslog => 'true' }
end
it { is_expected.to contain_sahara_config('DEFAULT/use_syslog').with_value(true) }
it { is_expected.to contain_sahara_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>') } it { is_expected.to contain_sahara_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>') }
end end
end end
@@ -71,6 +78,7 @@ describe 'sahara::logging' do
shared_examples_for 'basic logging options passed' do shared_examples_for 'basic logging options passed' do
context 'with passed params' do context 'with passed params' do
it { is_expected.to contain_sahara_config('DEFAULT/debug').with_value(true) } it { is_expected.to contain_sahara_config('DEFAULT/debug').with_value(true) }
it { is_expected.to contain_sahara_config('DEFAULT/use_syslog').with_value(true) }
it { is_expected.to contain_sahara_config('DEFAULT/use_stderr').with_value(false) } it { is_expected.to contain_sahara_config('DEFAULT/use_stderr').with_value(false) }
it { is_expected.to contain_sahara_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0') } it { is_expected.to contain_sahara_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0') }
it { is_expected.to contain_sahara_config('DEFAULT/log_dir').with_value('/tmp/sahara') } it { is_expected.to contain_sahara_config('DEFAULT/log_dir').with_value('/tmp/sahara') }