Deprecate some log options
[DEFAULT/use_syslog] was deprecated in Mitaka [1] init.pp - deprecate use_syslog, add warning, remove reference tests - remove use_syslog and [DEFAULT/use_syslog] verification. [1] http://docs.openstack.org/mitaka/config-reference/tables/conf-changes/neutron.html log_facility is deprecated and will be removed after Newton cycle. Change-Id: I07180cca9189eb62f41621c9c2230946206098b3
This commit is contained in:
@@ -296,18 +296,10 @@
|
||||
# (optional) CA certificate file to use to verify connecting clients
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*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
|
||||
#
|
||||
# [*log_file*]
|
||||
# (optional) Where to log
|
||||
# Defaults to undef
|
||||
@@ -359,6 +351,14 @@
|
||||
# (optional) Deprecated. Verbose logging
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*use_syslog*]
|
||||
# (optional) Deprecated. Use syslog for logging
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*log_facility*]
|
||||
# (optional) Deprecated. Syslog facility to receive log lines
|
||||
# Defaults to undef
|
||||
#
|
||||
class neutron (
|
||||
$enabled = true,
|
||||
$package_ensure = 'present',
|
||||
@@ -426,9 +426,7 @@ class neutron (
|
||||
$cert_file = $::os_service_default,
|
||||
$key_file = $::os_service_default,
|
||||
$ca_file = $::os_service_default,
|
||||
$use_syslog = undef,
|
||||
$use_stderr = undef,
|
||||
$log_facility = undef,
|
||||
$log_file = undef,
|
||||
$log_dir = undef,
|
||||
$manage_logging = true,
|
||||
@@ -441,6 +439,8 @@ class neutron (
|
||||
# DEPRECATED PARAMETERS
|
||||
$network_device_mtu = undef,
|
||||
$verbose = undef,
|
||||
$use_syslog = undef,
|
||||
$log_facility = undef,
|
||||
) {
|
||||
|
||||
include ::neutron::params
|
||||
@@ -452,6 +452,14 @@ class neutron (
|
||||
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($cert_file) {
|
||||
fail('The cert_file parameter is required when use_ssl is set to true')
|
||||
|
@@ -8,18 +8,10 @@
|
||||
# (optional) Print debug messages in the logs
|
||||
# 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
|
||||
#
|
||||
# [*log_facility*]
|
||||
# (optional) Syslog facility to receive log lines
|
||||
# Defaults to $::os_service_default
|
||||
#
|
||||
# [*log_file*]
|
||||
# (optional) Where to log
|
||||
# Defaults to $::os_service_default
|
||||
@@ -107,11 +99,17 @@
|
||||
# (optional) Deprecated. Verbose logging
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*use_syslog*]
|
||||
# (optional) Deprecated. Use syslog for logging
|
||||
# Defaults to undef
|
||||
#
|
||||
# [*log_facility*]
|
||||
# (optional) Deprecated. Syslog facility to receive log lines
|
||||
# Defaults to undef
|
||||
#
|
||||
class neutron::logging (
|
||||
$debug = $::os_service_default,
|
||||
$use_syslog = $::os_service_default,
|
||||
$use_stderr = $::os_service_default,
|
||||
$log_facility = $::os_service_default,
|
||||
$log_file = $::os_service_default,
|
||||
$log_dir = '/var/log/neutron',
|
||||
$log_config_append = $::os_service_default,
|
||||
@@ -130,12 +128,12 @@ class neutron::logging (
|
||||
$fatal_deprecations = $::os_service_default,
|
||||
# Deprecated
|
||||
$verbose = undef,
|
||||
$use_syslog = undef,
|
||||
$log_facility = undef,
|
||||
) {
|
||||
|
||||
$debug_real = pick($::neutron::debug,$debug)
|
||||
$use_syslog_real = pick($::neutron::use_syslog,$use_syslog)
|
||||
$use_stderr_real = pick($::neutron::use_stderr,$use_stderr)
|
||||
$log_facility_real = pick($::neutron::log_facility,$log_facility)
|
||||
$log_file_real = pick($::neutron::log_file,$log_file)
|
||||
$log_dir_real = pick($::neutron::log_dir,$log_dir)
|
||||
|
||||
@@ -143,11 +141,18 @@ class neutron::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')
|
||||
}
|
||||
|
||||
if $log_facility {
|
||||
warning('log_facility is deprecated, has no effect and will be removed after Newton cycle. Please use syslog_log_facility instead.')
|
||||
}
|
||||
|
||||
oslo::log { 'neutron_config':
|
||||
debug => $debug_real,
|
||||
use_stderr => $use_stderr_real,
|
||||
use_syslog => $use_syslog_real,
|
||||
syslog_log_facility => $log_facility_real,
|
||||
syslog_log_facility => $syslog_log_facility,
|
||||
log_file => $log_file_real,
|
||||
log_dir => $log_dir_real,
|
||||
log_config_append => $log_config_append,
|
||||
|
@@ -0,0 +1,5 @@
|
||||
---
|
||||
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.
|
@@ -76,9 +76,6 @@ describe 'neutron' do
|
||||
it_configures 'with SSL socket options set'
|
||||
it_configures 'with SSL socket options set with wrong parameters'
|
||||
it_configures 'with SSL socket options left by default'
|
||||
it_configures 'with syslog disabled'
|
||||
it_configures 'with syslog enabled'
|
||||
it_configures 'with syslog enabled and custom settings'
|
||||
it_configures 'with log_file specified'
|
||||
it_configures 'without service_plugins'
|
||||
it_configures 'with service_plugins'
|
||||
@@ -262,14 +259,6 @@ describe 'neutron' do
|
||||
it_raises 'a Puppet::Error', /The ca_file parameter requires that use_ssl to be set to true/
|
||||
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
|
||||
before do
|
||||
@@ -355,33 +344,6 @@ describe 'neutron' do
|
||||
|
||||
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)
|
||||
is_expected.to contain_neutron_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples_for 'with syslog enabled and custom settings' do
|
||||
before do
|
||||
params.merge!(
|
||||
:use_syslog => 'true',
|
||||
:log_facility => 'LOG_LOCAL0'
|
||||
)
|
||||
end
|
||||
|
||||
it do
|
||||
is_expected.to contain_neutron_config('DEFAULT/use_syslog').with_value(true)
|
||||
is_expected.to contain_neutron_config('DEFAULT/syslog_log_facility').with_value('LOG_LOCAL0')
|
||||
end
|
||||
end
|
||||
|
||||
shared_examples_for 'with log_file specified' do
|
||||
before do
|
||||
params.merge!(
|
||||
|
@@ -24,9 +24,8 @@ describe 'neutron::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',
|
||||
:syslog_log_facility => 'LOG_USER',
|
||||
:log_dir => '/var/log',
|
||||
:log_file => 'neutron.log',
|
||||
:watch_log_file => true,
|
||||
@@ -54,7 +53,6 @@ describe 'neutron::logging' do
|
||||
|
||||
shared_examples 'basic default logging settings' 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/syslog_log_facility').with(:value => '<SERVICE DEFAULT>')
|
||||
is_expected.to contain_neutron_config('DEFAULT/log_dir').with(:value => '/var/log/neutron')
|
||||
@@ -66,7 +64,6 @@ describe 'neutron::logging' do
|
||||
|
||||
shared_examples 'basic non-default logging settings' 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/syslog_log_facility').with(:value => 'LOG_USER')
|
||||
is_expected.to contain_neutron_config('DEFAULT/log_dir').with(:value => '/var/log')
|
||||
|
Reference in New Issue
Block a user