Clean up deprecated database parameters

Change-Id: I25c93e55e993eea0ec094c7cf771eec9950f9adf
This commit is contained in:
Takashi Kajinami 2022-01-23 18:37:10 +09:00
parent 053c6e7729
commit f972678114
3 changed files with 30 additions and 131 deletions

View File

@ -97,12 +97,6 @@
# (Optional) If set, use this value for pool_timeout with SQLAlchemy.
# 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 nova::db (
$database_connection = $::os_service_default,
$slave_connection = $::os_service_default,
@ -122,49 +116,31 @@ class nova::db (
$api_database_retry_interval = $::os_service_default,
$api_database_max_overflow = $::os_service_default,
$api_database_pool_timeout = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) {
include nova::deps
if $::nova::database_min_pool_size or $database_min_pool_size {
warning('The database_min_pool_size parameter is deprecated, and will be removed in a future release.')
}
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
# to use nova::<myparam> first the nova::db::<myparam>
$database_connection_real = pick($::nova::database_connection, $database_connection)
$slave_connection_real = pick($::nova::slave_connection, $slave_connection)
$api_database_connection_real = pick($::nova::api_database_connection, $api_database_connection)
$api_slave_connection_real = pick($::nova::api_slave_connection, $api_slave_connection)
$database_connection_recycle_time_real = pick($::nova::database_idle_timeout, $database_connection_recycle_time)
$database_max_pool_size_real = pick($::nova::database_max_pool_size, $database_max_pool_size)
$database_max_retries_real = pick($::nova::database_max_retries, $database_max_retries)
$database_retry_interval_real = pick($::nova::database_retry_interval, $database_retry_interval)
$database_max_overflow_real = pick($::nova::database_max_overflow, $database_max_overflow)
if !is_service_default($database_connection_real) {
if !is_service_default($database_connection) {
oslo::db { 'nova_config':
db_max_retries => $database_db_max_retries,
connection => $database_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,
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,
slave_connection => $slave_connection_real,
slave_connection => $slave_connection,
}
}
if !is_service_default($api_database_connection_real) {
if !is_service_default($api_database_connection) {
oslo::db { 'api_database':
config => 'nova_config',
config_group => 'api_database',
connection => $api_database_connection_real,
slave_connection => $api_slave_connection_real,
connection => $api_database_connection,
slave_connection => $api_slave_connection,
connection_recycle_time => $api_database_connection_recycle_time,
max_pool_size => $api_database_max_pool_size,
max_retries => $api_database_max_retries,

View File

@ -370,10 +370,6 @@
# (optional) The strategy to use for auth: noauth or keystone.
# Defaults to undef
#
# [*database_min_pool_size*]
# (optional) Minimum number of SQL connections to keep open in a pool.
# Defaults to undef.
#
# [*os_region_name*]
# (optional) Sets the os_region_name flag. For environments with
# more than one endpoint per service, this is required to make
@ -392,42 +388,6 @@
# (optional) Sets a version cap for messages sent to console services
# Defaults to undef
#
# [*database_connection*]
# (optional) Connection url for the nova database.
# Defaults to undef.
#
# [*slave_connection*]
# (optional) Connection url to connect to nova slave database (read-only).
# Defaults to undef.
#
# [*api_database_connection*]
# (optional) Connection url for the nova API database.
# Defaults to undef.
#
# [*api_slave_connection*]
# (optional) Connection url to connect to nova API 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.
@ -528,19 +488,9 @@ class nova(
$dhcp_domain = $::os_service_default,
# DEPRECATED PARAMETERS
$auth_strategy = undef,
$database_min_pool_size = undef,
$os_region_name = undef,
$cinder_catalog_info = undef,
$upgrade_level_console = undef,
$database_connection = undef,
$slave_connection = undef,
$api_database_connection = undef,
$api_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,
$glance_endpoint_override = undef,
$glance_num_retries = undef,
@ -576,52 +526,6 @@ in a future release. Use nova::cinder::catalog_info instead')
no effect.')
}
if $database_connection != undef {
warning('The database_connection parameter is deprecated and will be \
removed in a future realse. Use nova::db::database_connection instead')
}
if $slave_connection != undef {
warning('The slave_connection parameter is deprecated and will be \
removed in a future realse. Use nova::db::slave_connection instead')
}
if $api_database_connection != undef {
warning('The api_database_connection parameter is deprecated and will be \
removed in a future realse. Use nova::db::api_database_connection instead')
}
if $api_slave_connection != undef {
warning('The api_slave_connection parameter is deprecated and will be \
removed in a future realse. Use nova::db::api_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 nova::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 nova::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 nova::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 nova::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 nova::db::database_max_overflow instead')
}
if $glance_endpoint_override != undef {
warning('The glance_endpoint_override parameter is deprecated. \
Use nova::glance::endpoint_override instead.')

View File

@ -0,0 +1,19 @@
---
upgrade:
- |
The following parameters of the ``nova`` class have been removed.
- ``database_min_pool_size``
- ``database_connection``
- ``slave_connection``
- ``api_database_connection``
- ``api_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 ``nova::db`` class has been
removed.