Trove Deprecations

Deprecation of parameters listed in Mitaka during Newton cycle [1]

[1] http://docs.openstack.org/mitaka/config-reference/tables/conf-changes/trove.html

Change-Id: I700ddfd674a817c190916890a4a74f82ed82d3c1
This commit is contained in:
Iury Gregory Melo Ferreira 2016-05-22 20:29:49 -03:00
parent c780bfc964
commit 2d5ee453cf
12 changed files with 114 additions and 56 deletions

View File

@ -46,10 +46,6 @@
# 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
@ -158,12 +154,15 @@
# (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',
@ -192,6 +191,7 @@ class trove::api(
$auth_port = '35357',
$auth_protocol = 'http',
$verbose = undef,
$use_syslog = undef,
) inherits trove {
include ::trove::deps
@ -204,6 +204,10 @@ 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,10 +30,6 @@
# 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 false.
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
@ -63,7 +59,11 @@
# [*verbose*]
# (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,7 +71,6 @@ 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',
@ -80,6 +79,7 @@ class trove::conductor(
$trace_sqlalchemy = $::os_service_default,
# Deprecated
$verbose = undef,
$use_syslog = undef,
) inherits trove {
include ::trove::deps
@ -89,6 +89,10 @@ 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'
@ -172,7 +176,6 @@ 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,10 +30,6 @@
# 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 false.
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
@ -79,6 +75,10 @@
# 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,7 +86,6 @@ 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,
@ -96,6 +95,7 @@ class trove::guestagent(
$rabbit_port = $::trove::rabbit_port,
#Deprecated
$verbose = undef,
$use_syslog = undef,
) inherits trove {
include ::trove::deps
@ -105,6 +105,10 @@ 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;
@ -174,7 +178,6 @@ 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,10 +8,6 @@
# (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
@ -95,9 +91,12 @@
# [*verbose*]
# (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',
@ -116,13 +115,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)
@ -133,10 +132,13 @@ 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

@ -4,7 +4,7 @@
#
# === Parameters
#
# [*max_instances_per_user*]
# [*max_instances_per_tenant*]
# (optional) Default maximum number of instances per tenant.
# Defaults to 5.
#
@ -12,12 +12,12 @@
# (optional) Default maximum volume size (in GB) for an instance.
# Defaults to 5.
#
# [*max_volumes_per_user*]
# [*max_volumes_per_tenant*]
# (optional) Default maximum volume capacity (in GB) spanning across
# all Trove volumes per tenant.
# Defaults to 20.
#
# [*max_backups_per_user*]
# [*max_backups_per_tenant*]
# (optional) Default maximum number of backups created by a tenant.
# Defaults to 50.
#
@ -25,21 +25,61 @@
# (optional) Default driver to use for quota checks.
# Defaults to 'trove.quota.quota.DbQuotaDriver'.
#
# === DEPRECATED PARAMETERS
#
# [*max_instances_per_user*]
# (optional) DEPRECATED. Default maximum number of instances per tenant.
# Defaults to undef
#
# [*max_volumes_per_user*]
# (optional) DEPRECATED. Default maximum volume capacity (in GB) spanning across
# all Trove volumes per tenant.
# Defaults to undef
#
# [*max_backups_per_user*]
# (optional) DEPRECATED. Default maximum number of backups created by a tenant.
# Defaults to undef
#
class trove::quota (
$max_instances_per_user = 5,
$max_instances_per_tenant = 5,
$max_accepted_volume_size = 5,
$max_volumes_per_user = 20,
$max_backups_per_user = 50,
$max_volumes_per_tenant = 20,
$max_backups_per_tenant = 50,
$quota_driver = 'trove.quota.quota.DbQuotaDriver',
# Deprecated
$max_instances_per_user = undef,
$max_volumes_per_user = undef,
$max_backups_per_user = undef,
) {
include ::trove::deps
if $max_instances_per_user {
warning('max_instances_per_user deprecated, has no effect and will be removed after Newton cycle. Please use max_instances_per_tenant instead.')
$max_instances_per_tenant_real = $max_instances_per_user
} else {
$max_instances_per_tenant_real = $max_instances_per_tenant
}
if $max_volumes_per_user {
warning('max_volumes_per_user deprecated, has no effect and will be removed after Newton cycle. Please use max_volumes_per_tenant instead.')
$max_volumes_per_tenant_real = $max_volumes_per_user
} else {
$max_volumes_per_tenant_real = $max_volumes_per_tenant
}
if $max_backups_per_user {
warning('max_backups_per_user deprecated, has no effect and will be removed after Newton cycle. Please use max_backups_per_tenant instead.')
$max_backups_per_tenant_real = $max_backups_per_user
} else {
$max_backups_per_tenant_real = $max_backups_per_tenant
}
trove_config {
'DEFAULT/max_instances_per_user': value => $max_instances_per_user;
'DEFAULT/max_instances_per_tenant': value => $max_instances_per_tenant_real;
'DEFAULT/max_accepted_volume_size': value => $max_accepted_volume_size;
'DEFAULT/max_volumes_per_user': value => $max_volumes_per_user;
'DEFAULT/max_backups_per_user': value => $max_backups_per_user;
'DEFAULT/max_volumes_per_tenant': value => $max_volumes_per_tenant_real;
'DEFAULT/max_backups_per_tenant': value => $max_backups_per_tenant_real;
'DEFAULT/quota_driver': value => $quota_driver;
}
}

View File

@ -47,10 +47,6 @@
# 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 false.
#
# [*log_facility*]
# (optional) Syslog facility to receive log lines.
# Defaults to 'LOG_USER'.
@ -85,13 +81,16 @@
# (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,
@ -102,6 +101,7 @@ class trove::taskmanager(
#DEPRECATED OPTIONS
$use_guestagent_template = true,
$verbose = undef,
$use_syslog = undef,
) inherits trove {
include ::trove::deps
@ -111,6 +111,10 @@ 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'
@ -234,7 +238,6 @@ class trove::taskmanager(
debug => $debug,
log_file => $log_file,
log_dir => $log_dir,
use_syslog => $use_syslog,
syslog_log_facility => $log_facility
}

View File

@ -0,0 +1,9 @@
---
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:
- max_volumes_per_tenant, max_instances_per_tenant, max_backups_per_tenant
added to subistitute deprecated parameters.

View File

@ -27,7 +27,6 @@ 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,7 +28,6 @@ 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,7 +23,6 @@ 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',
@ -56,7 +55,6 @@ 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')
@ -67,7 +65,6 @@ 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

@ -4,13 +4,13 @@ describe 'trove::quota' do
describe 'with default parameters' do
it 'contains default values' do
is_expected.to contain_trove_config('DEFAULT/max_instances_per_user').with(
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with(
:value => 5)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
:value => 5)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_user').with(
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with(
:value => 20)
is_expected.to contain_trove_config('DEFAULT/max_backups_per_user').with(
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with(
:value => 50)
is_expected.to contain_trove_config('DEFAULT/quota_driver').with(
:value => 'trove.quota.quota.DbQuotaDriver')
@ -19,20 +19,20 @@ describe 'trove::quota' do
describe 'with overridden parameters' do
let :params do
{ :max_instances_per_user => 10,
{ :max_instances_per_tenant => 10,
:max_accepted_volume_size => 10,
:max_volumes_per_user => 100,
:max_backups_per_user => 100,
:max_volumes_per_tenant => 100,
:max_backups_per_tenant => 100,
}
end
it 'contains overrided values' do
is_expected.to contain_trove_config('DEFAULT/max_instances_per_user').with(
is_expected.to contain_trove_config('DEFAULT/max_instances_per_tenant').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_accepted_volume_size').with(
:value => 10)
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_user').with(
is_expected.to contain_trove_config('DEFAULT/max_volumes_per_tenant').with(
:value => 100)
is_expected.to contain_trove_config('DEFAULT/max_backups_per_user').with(
is_expected.to contain_trove_config('DEFAULT/max_backups_per_tenant').with(
:value => 100)
end
end

View File

@ -52,7 +52,6 @@ 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')