Remove deprecated neutron database params

Depends-On: https://review.opendev.org/737544
Change-Id: I0f962637a13db9c3151a3c27530e97f15b0a4f59
This commit is contained in:
Tobias Urdin 2020-06-23 13:07:31 +02:00
parent de2be7503c
commit 8993e81274
3 changed files with 17 additions and 66 deletions

View File

@ -38,12 +38,6 @@
# before error is raised. Set to -1 to specify an infinite retry count.
# 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 neutron::db (
$database_connection = 'sqlite:////var/lib/neutron/ovs.sqlite',
$database_connection_recycle_time = $::os_service_default,
@ -53,39 +47,22 @@ class neutron::db (
$database_max_overflow = $::os_service_default,
$database_pool_timeout = $::os_service_default,
$database_db_max_retries = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
) {
include neutron::deps
if $::neutron::server::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.')
}
# TODO(tobias-urdin): Remove the database_* params in neutron::server is removed.
# NOTE(spredzy): In order to keep backward compatibility we rely on the pick function
# to use neutron::<myparam> if neutron::db::<myparam> isn't specified.
$database_connection_real = pick($::neutron::server::database_connection, $database_connection)
$database_connection_recycle_time_real = pick($::neutron::server::database_idle_timeout,
$database_connection_recycle_time)
$database_max_pool_size_real = pick($::neutron::server::database_max_pool_size, $database_max_pool_size)
$database_max_retries_real = pick($::neutron::server::database_max_retries, $database_max_retries)
$database_retry_interval_real = pick($::neutron::server::database_retry_interval, $database_retry_interval)
$database_max_overflow_real = pick($::neutron::server::database_max_overflow, $database_max_overflow)
validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection_real,
validate_legacy(Oslo::Dbconn, 'validate_re', $database_connection,
['^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?'])
if $database_connection_real {
if $database_connection {
oslo::db { 'neutron_config':
connection => $database_connection_real,
connection_recycle_time => $database_connection_recycle_time_real,
max_retries => $database_max_retries_real,
retry_interval => $database_retry_interval_real,
max_pool_size => $database_max_pool_size_real,
max_overflow => $database_max_overflow_real,
connection => $database_connection,
connection_recycle_time => $database_connection_recycle_time,
max_retries => $database_max_retries,
retry_interval => $database_retry_interval,
max_pool_size => $database_max_pool_size,
max_overflow => $database_max_overflow,
pool_timeout => $database_pool_timeout,
db_max_retries => $database_db_max_retries,
}

View File

@ -227,34 +227,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 neutron database.
# (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 10)
#
# [*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.
#
# [*ensure_fwaas_package*]
# (Optional) Ensures installation of FWaaS package before starting API service.
# Set to true to ensure installation of the package that is required to start neutron service if service_plugin is enabled.
@ -299,13 +271,6 @@ class neutron::server (
$ovs_integration_bridge = $::os_service_default,
$igmp_snooping_enable = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
$database_connection = undef,
$database_max_retries = undef,
$database_idle_timeout = undef,
$database_retry_interval = undef,
$database_max_pool_size = undef,
$database_max_overflow = undef,
$ensure_fwaas_package = undef,
) inherits ::neutron::params {

View File

@ -0,0 +1,9 @@
---
upgrade:
- |
The neutron::server::database_min_pool_size and
neutron::db::database_min_pool_size parameters is removed.
- |
The database_connection, database_max_retries, database_idle_timeout,
database_retry_interval, database_max_pool_size and database_max_overflow
parameters in neutron::server is removed, use the neutron::db class instead.