Clean up deprecated database parameters

Change-Id: I64015ca104e66b9b0bfe7edc6961f2610adc01e5
This commit is contained in:
Takashi Kajinami 2022-01-23 18:43:09 +09:00
parent d398887c51
commit 0eb8b285cf
3 changed files with 24 additions and 108 deletions

View File

@ -47,12 +47,6 @@
# Cluster (NDB).
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*database_min_pool_size*]
# Minimum number of SQL connections to keep open in a pool.
# (Optional) Defaults to undef.
#
class aodh::db (
$database_db_max_retries = $::os_service_default,
$database_connection = 'sqlite:////var/lib/aodh/aodh.sqlite',
@ -64,38 +58,19 @@ class aodh::db (
$database_max_overflow = $::os_service_default,
$database_pool_timeout = $::os_service_default,
$mysql_enable_ndb = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) {
include aodh::deps
if defined('$::aodh::database_min_pool_size') {
$database_min_pool_size_real = $::aodh::database_min_pool_size
} else {
$database_min_pool_size_real = $database_min_pool_size
}
if $database_min_pool_size_real {
warning('The database_min_pool_size parameter is deprecated, and will be removed in a future release.')
}
$database_connection_real = pick($::aodh::database_connection, $database_connection)
$slave_connection_real = pick($::aodh::slave_connection, $slave_connection)
$database_max_pool_size_real = pick($::aodh::database_max_pool_size, $database_max_pool_size)
$database_max_retries_real = pick($::aodh::database_max_retries, $database_max_retries)
$database_retry_interval_real = pick($::aodh::database_retry_interval, $database_retry_interval)
$database_max_overflow_real = pick($::aodh::database_max_overflow, $database_max_overflow)
$database_connection_recycle_time_real = pick($::aodh::database_idle_timeout, $database_connection_recycle_time)
oslo::db { 'aodh_config':
db_max_retries => $database_db_max_retries,
connection => $database_connection_real,
slave_connection => $slave_connection_real,
connection_recycle_time => $database_connection_recycle_time_real,
max_pool_size => $database_max_pool_size_real,
max_retries => $database_max_retries_real,
retry_interval => $database_retry_interval_real,
max_overflow => $database_max_overflow_real,
connection => $database_connection,
slave_connection => $slave_connection,
connection_recycle_time => $database_connection_recycle_time,
max_pool_size => $database_max_pool_size,
max_retries => $database_max_retries,
retry_interval => $database_retry_interval,
max_overflow => $database_max_overflow,
pool_timeout => $database_pool_timeout,
mysql_enable_ndb => $mysql_enable_ndb,
}

View File

@ -187,38 +187,6 @@
#
# DEPRECATED PARAMETERS
#
# [*database_min_pool_size*]
# (optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to undef.
#
# [*database_connection*]
# (optional) Connection url for the aodh database.
# Defaults to undef.
#
# [*slave_connection*]
# (optional) Connection url to connect to aodh slave database (read-only).
# Defaults to undef.
#
# [*database_max_retries*]
# (optional) Maximum database connection retries during startup.
# Defaults to undef.
#
# [*database_idle_timeout*]
# (optional) Timeout before idle database connections are reaped.
# Defaults to undef.
#
# [*database_retry_interval*]
# (optional) Interval between retries of opening a database connection.
# Defaults to undef.
#
# [*database_max_pool_size*]
# (optional) Maximum number of SQL connections to keep open in a pool.
# Defaults to undef.
#
# [*database_max_overflow*]
# (optional) If set, use this value for max_overflow with sqlalchemy.
# Defaults to: undef.
#
# [*amqp_allow_insecure_clients*]
# (Optional) Accept clients using either SSL or plain TCP
# Defaults to undef.
@ -263,14 +231,6 @@ class aodh (
$notification_topics = $::os_service_default,
$purge_config = false,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
$database_connection = undef,
$slave_connection = undef,
$database_idle_timeout = undef,
$database_max_pool_size = undef,
$database_max_retries = undef,
$database_retry_interval = undef,
$database_max_overflow = undef,
$amqp_allow_insecure_clients = undef,
) inherits aodh::params {
@ -282,42 +242,6 @@ class aodh (
will be removed in a future release.')
}
if $database_connection != undef {
warning('The database_connection parameter is deprecated and will be \
removed in a future realse. Use aodh::db::database_connection instead')
}
if $slave_connection != undef {
warning('The slave_connection parameter is deprecated and will be \
removed in a future realse. Use aodh::db::slave_connection instead')
}
if $database_idle_timeout != undef {
warning('The database_idle_timeout parameter is deprecated and will be \
removed in a future realse. Use aodh::db::database_connection_recycle_time \
instead')
}
if $database_max_pool_size != undef {
warning('The database_max_pool_size parameter is deprecated and will be \
removed in a future realse. Use aodh::db::database_max_pool_size instead')
}
if $database_max_retries!= undef {
warning('The database_max_retries parameter is deprecated and will be \
removed in a future realse. Use aodh::db::database_max_retries instead')
}
if $database_retry_interval != undef {
warning('The database_retry_interval parameter is deprecated and will be \
removed in a future realse. Use aodh::db::database_retry_interval instead')
}
if $database_max_overflow != undef {
warning('The database_max_overflow parameter is deprecated and will be \
removed in a future realse. Use aodh::db::database_max_overflow instead')
}
package { 'aodh':
ensure => $package_ensure,
name => $::aodh::params::common_package_name,

View File

@ -0,0 +1,17 @@
---
upgrade:
- |
The following parameters of the ``aodh`` class has been removed.
- ``database_min_pool_size``
- ``database_connection``
- ``slave_connection``
- ``database_idle_timeout``
- ``database_max_overflow``
- ``database_max_pool_size``
- ``database_max_retries``
- ``database_retry_interval``
- |
The ``database_min_pool_size`` parameter of the ``aodh::db`` class has been
removed.