Revert "Deprecate some log options"

This commit partially reverts original commit.

use_syslog option is not deprecated and still actual.

This reverts commit ba53325693.

Change-Id: Ia4f91a4e3ceac9ffbeab164498fadcd4c6bc8ce1
This commit is contained in:
Denis Egorenko
2016-05-31 16:45:35 +03:00
committed by Iury Gregory Melo Ferreira
parent ccbe831848
commit 82aff7b8ce
5 changed files with 43 additions and 26 deletions

View File

@@ -302,6 +302,10 @@
# (optional) CA certificate file to use to verify connecting clients # (optional) CA certificate file to use to verify connecting clients
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*use_syslog*]
# (optional) Use syslog for logging
# Defaults to undef
#
# [*use_stderr*] # [*use_stderr*]
# (optional) Use stderr for logging # (optional) Use stderr for logging
# Defaults to undef # Defaults to undef
@@ -359,12 +363,8 @@
# (optional) Deprecated. Verbose logging # (optional) Deprecated. Verbose logging
# Defaults to undef # Defaults to undef
# #
# [*use_syslog*]
# (optional) Deprecated. Use syslog for logging
# Defaults to undef
#
# [*log_facility*] # [*log_facility*]
# (optional) Deprecated. Syslog facility to receive log lines # (optional) Syslog facility to receive log lines
# Defaults to undef # Defaults to undef
# #
class neutron ( class neutron (
@@ -435,6 +435,7 @@ class neutron (
$cert_file = $::os_service_default, $cert_file = $::os_service_default,
$key_file = $::os_service_default, $key_file = $::os_service_default,
$ca_file = $::os_service_default, $ca_file = $::os_service_default,
$use_syslog = undef,
$use_stderr = undef, $use_stderr = undef,
$log_file = undef, $log_file = undef,
$log_dir = undef, $log_dir = undef,
@@ -448,7 +449,6 @@ class neutron (
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
$network_device_mtu = undef, $network_device_mtu = undef,
$verbose = undef, $verbose = undef,
$use_syslog = undef,
$log_facility = undef, $log_facility = undef,
) { ) {
@@ -461,14 +461,6 @@ class neutron (
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.')
}
if $log_facility {
warning('log_facility is deprecated, has no effect and will be removed after Newton cycle.')
}
if ! is_service_default($use_ssl) and ($use_ssl) { if ! is_service_default($use_ssl) and ($use_ssl) {
if is_service_default($cert_file) { if is_service_default($cert_file) {
fail('The cert_file parameter is required when use_ssl is set to true') fail('The cert_file parameter is required when use_ssl is set to true')
@@ -491,6 +483,10 @@ class neutron (
warning('kombu_missing_consumer_retry_timeout should not be longer than rpc_response_timeout') warning('kombu_missing_consumer_retry_timeout should not be longer than rpc_response_timeout')
} }
if $log_facility {
warning('log_facility is deprecated, has no effect and will be removed after Newton cycle.')
}
if $memcache_servers { if $memcache_servers {
validate_array($memcache_servers) validate_array($memcache_servers)
} }

View File

@@ -8,6 +8,10 @@
# (optional) Print debug messages in the logs # (optional) Print debug messages in the logs
# Defaults to $::os_service_default # Defaults to $::os_service_default
# #
# [*use_syslog*]
# (optional) Use syslog for logging
# 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
@@ -99,16 +103,13 @@
# (optional) Deprecated. Verbose logging # (optional) Deprecated. Verbose logging
# Defaults to undef # Defaults to undef
# #
# [*use_syslog*]
# (optional) Deprecated. Use syslog for logging
# Defaults to undef
#
# [*log_facility*] # [*log_facility*]
# (optional) Deprecated. Syslog facility to receive log lines # (optional) Syslog facility to receive log lines
# Defaults to undef # Defaults to undef
# #
class neutron::logging ( class neutron::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_file = $::os_service_default, $log_file = $::os_service_default,
$log_dir = '/var/log/neutron', $log_dir = '/var/log/neutron',
@@ -128,11 +129,11 @@ class neutron::logging (
$fatal_deprecations = $::os_service_default, $fatal_deprecations = $::os_service_default,
# Deprecated # Deprecated
$verbose = undef, $verbose = undef,
$use_syslog = undef,
$log_facility = undef, $log_facility = undef,
) { ) {
$debug_real = pick($::neutron::debug,$debug) $debug_real = pick($::neutron::debug,$debug)
$use_syslog_real = pick($::neutron::use_syslog,$use_syslog)
$use_stderr_real = pick($::neutron::use_stderr,$use_stderr) $use_stderr_real = pick($::neutron::use_stderr,$use_stderr)
$log_file_real = pick($::neutron::log_file,$log_file) $log_file_real = pick($::neutron::log_file,$log_file)
$log_dir_real = pick($::neutron::log_dir,$log_dir) $log_dir_real = pick($::neutron::log_dir,$log_dir)
@@ -141,10 +142,6 @@ class neutron::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')
}
if $log_facility { if $log_facility {
warning('log_facility is deprecated, has no effect and will be removed after Newton cycle. Please use syslog_log_facility instead.') warning('log_facility is deprecated, has no effect and will be removed after Newton cycle. Please use syslog_log_facility instead.')
} }
@@ -152,6 +149,7 @@ class neutron::logging (
oslo::log { 'neutron_config': oslo::log { 'neutron_config':
debug => $debug_real, debug => $debug_real,
use_stderr => $use_stderr_real, use_stderr => $use_stderr_real,
use_syslog => $use_syslog_real,
syslog_log_facility => $syslog_log_facility, syslog_log_facility => $syslog_log_facility,
log_file => $log_file_real, log_file => $log_file_real,
log_dir => $log_dir_real, log_dir => $log_dir_real,

View File

@@ -1,5 +1,3 @@
--- ---
deprecations: deprecations:
- use_syslog in DEFAULT section was deprecated in Mitaka, this parameter
has no effect and will be removed in a future release.
- log_facility is Deprecated and will be removed after Newton cycle. - log_facility is Deprecated and will be removed after Newton cycle.

View File

@@ -76,6 +76,8 @@ describe 'neutron' do
it_configures 'with SSL socket options set' it_configures 'with SSL socket options set'
it_configures 'with SSL socket options set with wrong parameters' it_configures 'with SSL socket options set with wrong parameters'
it_configures 'with SSL socket options left by default' it_configures 'with SSL socket options left by default'
it_configures 'with syslog disabled'
it_configures 'with syslog enabled'
it_configures 'with log_file specified' it_configures 'with log_file specified'
it_configures 'without service_plugins' it_configures 'without service_plugins'
it_configures 'with service_plugins' it_configures 'with service_plugins'
@@ -261,6 +263,14 @@ describe 'neutron' do
it_raises 'a Puppet::Error', /The ca_file parameter requires that use_ssl to be set to true/ it_raises 'a Puppet::Error', /The ca_file parameter requires that use_ssl to be set to true/
end end
shared_examples_for 'with syslog disabled' do
before do
params.merge!(
:use_syslog => false,
)
end
it { is_expected.to contain_neutron_config('DEFAULT/use_syslog').with_value(false) }
end
shared_examples_for 'with non-default kombu options' do shared_examples_for 'with non-default kombu options' do
before do before do
@@ -346,6 +356,18 @@ describe 'neutron' do
end end
shared_examples_for 'with syslog enabled' do
before do
params.merge!(
:use_syslog => 'true'
)
end
it do
is_expected.to contain_neutron_config('DEFAULT/use_syslog').with_value(true)
end
end
shared_examples_for 'with log_file specified' do shared_examples_for 'with log_file specified' do
before do before do
params.merge!( params.merge!(

View File

@@ -24,6 +24,7 @@ describe 'neutron::logging' do
:instance_format => '[instance: %(uuid)s] ', :instance_format => '[instance: %(uuid)s] ',
:instance_uuid_format => '[instance: %(uuid)s] ', :instance_uuid_format => '[instance: %(uuid)s] ',
:log_date_format => '%Y-%m-%d %H:%M:%S', :log_date_format => '%Y-%m-%d %H:%M:%S',
:use_syslog => false,
:use_stderr => false, :use_stderr => false,
:syslog_log_facility => 'LOG_USER', :syslog_log_facility => 'LOG_USER',
:log_dir => '/var/log', :log_dir => '/var/log',
@@ -53,6 +54,7 @@ describe 'neutron::logging' do
shared_examples 'basic default logging settings' do shared_examples 'basic default logging settings' do
it 'configures neutron logging settins with default values' do it 'configures neutron logging settins with default values' do
is_expected.to contain_neutron_config('DEFAULT/use_syslog').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>') is_expected.to contain_neutron_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/syslog_log_facility').with(:value => '<SERVICE DEFAULT>') is_expected.to contain_neutron_config('DEFAULT/syslog_log_facility').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_neutron_config('DEFAULT/log_dir').with(:value => '/var/log/neutron') is_expected.to contain_neutron_config('DEFAULT/log_dir').with(:value => '/var/log/neutron')
@@ -64,6 +66,7 @@ describe 'neutron::logging' do
shared_examples 'basic non-default logging settings' do shared_examples 'basic non-default logging settings' do
it 'configures neutron logging settins with non-default values' do it 'configures neutron logging settins with non-default values' do
is_expected.to contain_neutron_config('DEFAULT/use_syslog').with(:value => 'false')
is_expected.to contain_neutron_config('DEFAULT/use_stderr').with(:value => 'false') is_expected.to contain_neutron_config('DEFAULT/use_stderr').with(:value => 'false')
is_expected.to contain_neutron_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_USER') is_expected.to contain_neutron_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_USER')
is_expected.to contain_neutron_config('DEFAULT/log_dir').with(:value => '/var/log') is_expected.to contain_neutron_config('DEFAULT/log_dir').with(:value => '/var/log')