Merge "Deprecate database options from the manila class"

This commit is contained in:
Zuul 2020-10-21 09:16:03 +00:00 committed by Gerrit Code Review
commit c4f3c1dad4
4 changed files with 76 additions and 48 deletions

View File

@ -2,31 +2,6 @@
#
# == Parameters
#
# [*sql_connection*]
# Url used to connect to database.
# (Optional) Defaults to undef.
#
# [*sql_idle_timeout*]
# Timeout when db connections should be reaped.
# (Optional) 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_retries*]
# Maximum db connection retries during startup.
# Setting -1 implies an infinite retry count.
# (Optional) Defaults to undef.
#
# [*database_max_overflow*]
# (optional) If set, use this value for max_overflow with sqlalchemy.
# Defaults to undef.
#
# [*state_path*]
# (optional) Directory for storing state.
# Defaults to '/var/lib/manila'
@ -218,17 +193,36 @@
#
# DEPRECATED PARAMETERS
#
# [*sql_connection*]
# Url used to connect to database.
# (Optional) Defaults to undef.
#
# [*sql_idle_timeout*]
# Timeout when db connections should be reaped.
# (Optional) Defaults to undef.
#
# [*database_min_pool_size*]
# (optional) Minimum number of SQL connections to keep open in a pool.
# 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_retries*]
# Maximum db connection retries during startup.
# Setting -1 implies an infinite retry count.
# (Optional) Defaults to undef.
#
# [*database_max_overflow*]
# (optional) If set, use this value for max_overflow with sqlalchemy.
# Defaults to undef.
#
class manila (
$sql_connection = undef,
$sql_idle_timeout = undef,
$database_max_retries = undef,
$database_retry_interval = undef,
$database_max_pool_size = undef,
$database_max_overflow = undef,
$default_transport_url = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
$control_exchange = 'openstack',
@ -274,12 +268,49 @@ class manila (
$host = $::os_service_default,
# DEPRECATED PARAMETERS
$database_min_pool_size = undef,
$sql_connection = undef,
$sql_idle_timeout = undef,
$database_max_retries = undef,
$database_retry_interval = undef,
$database_max_pool_size = undef,
$database_max_overflow = undef,
) {
include manila::deps
include manila::db
include manila::params
if $sql_connection != undef {
warning('The sql_connection parameter is deprecated and will be \
removed in a future realse. Use manila::db::database_connection instead')
}
if $sql_idle_timeout != undef {
warning('The sql_idle_timeout parameter is deprecated and will be \
removed in a future realse. Use manila::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 manila::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 manila::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 manila::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 manila::db::database_max_overflow instead')
}
if $use_ssl {
if !$cert_file {
fail('The cert_file parameter is required when use_ssl is set to true')

View File

@ -0,0 +1,12 @@
---
deprecations:
- |
The following options have been deprecated, as those options have been
moved to manila::db class.
- ``manila::sql_connection``
- ``manila::sql_idle_timeout``
- ``manila::database_max_overflow``
- ``manila::database_max_pool_size``
- ``manila::database_max_retries``
- ``manila::database_retry_interval``

View File

@ -2,7 +2,6 @@ require 'spec_helper'
describe 'manila' do
let :req_params do
{
:sql_connection => 'mysql+pymysql://user:password@host/database',
:purge_config => false,
}
end
@ -152,18 +151,6 @@ describe 'manila' do
it { is_expected.to contain_manila_config('oslo_messaging_rabbit/amqp_durable_queues').with_value(true) }
end
context 'with sqlite' do
let :params do
{
:sql_connection => 'sqlite:////var/lib/manila/manila.sqlite',
}
end
it { is_expected.to_not contain_class('mysql::python') }
it { is_expected.to_not contain_class('mysql::bindings') }
it { is_expected.to_not contain_class('mysql::bindings::python') }
end
context 'with SSL socket options set' do
let :params do
{
@ -226,9 +213,7 @@ describe 'manila' do
context 'with amqp rpc supplied' do
let :params do
{
:sql_connection => 'mysql+pymysql://user:password@host/database',
}
{}
end
it { is_expected.to contain_manila_config('oslo_messaging_amqp/server_request_prefix').with_value('exclusive') }

View File

@ -4,7 +4,7 @@ describe 'manila::share' do
shared_examples_for 'manila-share' do
let :pre_condition do
'class { "manila": sql_connection => "mysql://a:b@c/d" }'
'class { "manila": }'
end
it { is_expected.to contain_package('manila-share').with(