Revert "Trove Deprecations"

This commit partially reverts original commit.

use_syslog option is not deprecated and still actual.

This reverts commit 700ddfd674a817c190916890a4a74f82ed82d3c1

Change-Id: Ie7515a45abeb3b0b4a7833bd19a32fbab759765a
This commit is contained in:
Iury Gregory Melo Ferreira 2016-05-31 11:50:45 -03:00
parent 2d5ee453cf
commit a498d302b7
10 changed files with 38 additions and 49 deletions

View File

@ -46,6 +46,10 @@
# If set to boolean false, it will not log to any directory.
# Defaults to undef
#
# [*use_syslog*]
# (optional) Use syslog for logging.
# Defaults to undef
#
# [*use_stderr*]
# (optional) Use stderr for logging
# Defaults to undef
@ -154,15 +158,12 @@
# (optional) Deprecated. Rather to log the trove api service at verbose level.
# Defaults to undef
#
# [*use_syslog*]
# (optional) DEPRECATED. Use syslog for logging.
# Defaults to undef
#
class trove::api(
$keystone_password,
$debug = undef,
$log_file = undef,
$log_dir = undef,
$use_syslog = undef,
$use_stderr = undef,
$log_facility = undef,
$bind_host = '0.0.0.0',
@ -191,7 +192,6 @@ class trove::api(
$auth_port = '35357',
$auth_protocol = 'http',
$verbose = undef,
$use_syslog = undef,
) inherits trove {
include ::trove::deps
@ -204,10 +204,6 @@ class trove::api(
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.')
}
# basic service config
trove_config {
'DEFAULT/bind_host': value => $bind_host;

View File

@ -30,6 +30,10 @@
# If set to boolean false, it will not log to any directory.
# Defaults to '/var/log/trove'
#
# [*use_syslog*]
# (optional) Use syslog for logging.
# Defaults to $::os_service_default
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
@ -60,10 +64,6 @@
# (optional) Deprecated. Rather to log the trove api service at verbose level.
# Default: undef
#
# [*use_syslog*]
# (optional) Deprecated. Use syslog for logging.
# Defaults to undef.
#
class trove::conductor(
$enabled = true,
$manage_service = true,
@ -71,6 +71,7 @@ class trove::conductor(
$debug = $::os_service_default,
$log_file = '/var/log/trove/trove-conductor.log',
$log_dir = '/var/log/trove',
$use_syslog = $::os_service_default,
$log_facility = $::os_service_default,
$auth_url = 'http://localhost:5000/v2.0',
$conductor_manager = 'trove.conductor.manager.Manager',
@ -79,7 +80,6 @@ class trove::conductor(
$trace_sqlalchemy = $::os_service_default,
# Deprecated
$verbose = undef,
$use_syslog = undef,
) inherits trove {
include ::trove::deps
@ -89,10 +89,6 @@ class trove::conductor(
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 $::trove::database_connection {
if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
require 'mysql::bindings'
@ -176,6 +172,7 @@ class trove::conductor(
debug => $debug,
log_file => $log_file,
log_dir => $log_dir,
use_syslog => $use_syslog,
syslog_log_facility => $log_facility
}

View File

@ -30,6 +30,10 @@
# If set to boolean false, it will not log to any directory.
# Defaults to '/var/log/trove'
#
# [*use_syslog*]
# (optional) Use syslog for logging.
# Defaults to $::os_service_default
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
@ -75,10 +79,6 @@
# guest agent service at verbose level.
# Default: undef
#
# [*use_syslog*]
# (optional) Deprecated. Use syslog for logging.
# Defaults to false.
#
class trove::guestagent(
$enabled = true,
$manage_service = true,
@ -86,6 +86,7 @@ class trove::guestagent(
$debug = $::os_service_default,
$log_file = '/var/log/trove/guestagent.log',
$log_dir = '/var/log/trove',
$use_syslog = $::os_service_default,
$log_facility = $::os_service_default,
$auth_url = 'http://localhost:5000/v2.0',
$swift_url = $::os_service_default,
@ -95,7 +96,6 @@ class trove::guestagent(
$rabbit_port = $::trove::rabbit_port,
#Deprecated
$verbose = undef,
$use_syslog = undef,
) inherits trove {
include ::trove::deps
@ -105,10 +105,6 @@ class trove::guestagent(
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.')
}
# basic service config
trove_guestagent_config {
'DEFAULT/trove_auth_url': value => $auth_url;
@ -178,6 +174,7 @@ class trove::guestagent(
debug => $debug,
log_file => $log_file,
log_dir => $log_dir,
use_syslog => $use_syslog,
syslog_log_facility => $log_facility
}

View File

@ -8,6 +8,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
@ -92,11 +96,8 @@
# (Optional) Deprecated. Should the daemons log verbose messages
# Defaults to undef.
#
# [*use_syslog*]
# (Optional) Use syslog for logging.
# Defaults to undef
#
class trove::logging(
$use_syslog = $::os_service_default,
$use_stderr = $::os_service_default,
$log_facility = $::os_service_default,
$log_dir = '/var/log/trove',
@ -115,13 +116,13 @@ class trove::logging(
$log_date_format = $::os_service_default,
# Deprecated
$verbose = undef,
$use_syslog = undef,
) {
include ::trove::deps
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
# to use trove::<myparam> first then trove::logging::<myparam>.
$use_syslog_real = pick($::trove::api::use_syslog, $use_syslog)
$use_stderr_real = pick($::trove::api::use_stderr, $use_stderr)
$log_facility_real = pick($::trove::api::log_facility, $log_facility)
$log_dir_real = pick($::trove::api::log_dir, $log_dir)
@ -132,13 +133,10 @@ class trove::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')
}
oslo::log { 'trove_config':
debug => $debug_real,
use_stderr => $use_stderr_real,
use_syslog => $use_syslog_real,
log_dir => $log_dir_real,
log_file => $log_file_real,
syslog_log_facility => $log_facility_real,

View File

@ -47,6 +47,10 @@
# If set to boolean false, it will not log to any directory.
# Defaults to '/var/log/trove'
#
# [*use_syslog*]
# (optional) Use syslog for logging.
# Defaults to $::os_service_default
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
@ -81,16 +85,13 @@
# (optional) Deprecated. Rather to log the trove api service at verbose level.
# Default: undef
#
# [*use_syslog*]
# (optional) Deprecated. Use syslog for logging.
# Defaults to undef
#
class trove::taskmanager(
$enabled = true,
$manage_service = true,
$debug = $::os_service_default,
$log_file = '/var/log/trove/trove-taskmanager.log',
$log_dir = '/var/log/trove',
$use_syslog = $::os_service_default,
$log_facility = $::os_service_default,
$auth_url = 'http://localhost:5000/v2.0',
$heat_url = false,
@ -101,7 +102,6 @@ class trove::taskmanager(
#DEPRECATED OPTIONS
$use_guestagent_template = true,
$verbose = undef,
$use_syslog = undef,
) inherits trove {
include ::trove::deps
@ -111,10 +111,6 @@ class trove::taskmanager(
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 $::trove::database_connection {
if($::trove::database_connection =~ /mysql:\/\/\S+:\S+@\S+\/\S+/) {
require 'mysql::bindings'
@ -238,6 +234,7 @@ class trove::taskmanager(
debug => $debug,
log_file => $log_file,
log_dir => $log_dir,
use_syslog => $use_syslog,
syslog_log_facility => $log_facility
}

View File

@ -1,7 +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
- max_volumes_per_user, max_instances_per_user, max_backups_per_user was
deprecated in Mitaka and will be removed after Newton.
upgrade:

View File

@ -27,6 +27,7 @@ describe 'trove::conductor' do
it 'configures trove-conductor with default parameters' do
is_expected.to contain_trove_conductor_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_conductor_config('DEFAULT/log_file').with_value('/var/log/trove/trove-conductor.log')
is_expected.to contain_trove_conductor_config('DEFAULT/log_dir').with_value('/var/log/trove')

View File

@ -28,6 +28,7 @@ describe 'trove::guestagent' do
it 'configures trove-guestagent with default parameters' do
is_expected.to contain_trove_guestagent_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_guestagent_config('DEFAULT/log_file').with_value('/var/log/trove/guestagent.log')
is_expected.to contain_trove_guestagent_config('DEFAULT/log_dir').with_value('/var/log/trove')

View File

@ -23,6 +23,7 @@ describe 'trove::logging' do
:instance_format => '[instance: %(uuid)s] ',
:instance_uuid_format => '[instance: %(uuid)s] ',
:log_date_format => '%Y-%m-%d %H:%M:%S',
:use_syslog => true,
:use_stderr => false,
:log_facility => 'LOG_FOO',
:log_dir => '/var/log',
@ -55,6 +56,7 @@ describe 'trove::logging' do
shared_examples 'basic default logging settings' do
it 'configures trove logging settins with default values' do
is_expected.to contain_trove_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/use_stderr').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/syslog_log_facility').with(:value => '<SERVICE DEFAULT>')
is_expected.to contain_trove_config('DEFAULT/log_dir').with(:value => '/var/log/trove')
@ -65,6 +67,7 @@ describe 'trove::logging' do
shared_examples 'basic non-default logging settings' do
it 'configures trove logging settins with non-default values' do
is_expected.to contain_trove_config('DEFAULT/use_syslog').with(:value => 'true')
is_expected.to contain_trove_config('DEFAULT/use_stderr').with(:value => 'false')
is_expected.to contain_trove_config('DEFAULT/syslog_log_facility').with(:value => 'LOG_FOO')
is_expected.to contain_trove_config('DEFAULT/log_dir').with(:value => '/var/log')

View File

@ -52,6 +52,7 @@ describe 'trove::taskmanager' do
it 'configures trove-taskmanager with default parameters' do
is_expected.to contain_trove_taskmanager_config('DEFAULT/debug').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/use_syslog').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/syslog_log_facility').with_value('<SERVICE DEFAULT>')
is_expected.to contain_trove_taskmanager_config('DEFAULT/log_file').with_value('/var/log/trove/trove-taskmanager.log')
is_expected.to contain_trove_taskmanager_config('DEFAULT/log_dir').with_value('/var/log/trove')