Add pool_timeout option

Add pool_timeout option to configure this value for pool_timeout with
SQLAlchemy.

Change-Id: I58760e6cfee299c6d5aef48810484a59b03003ca
Closes-Bug: #1757581
This commit is contained in:
ZhongShengping 2018-03-22 11:09:50 +08:00
parent ceccdbd34c
commit 8c8263117d
3 changed files with 14 additions and 0 deletions

View File

@ -38,6 +38,10 @@
# If set, use this value for max_overflow with sqlalchemy.
# (Optional) Defaults to $::os_service_default
#
# [*database_pool_timeout*]
# (Optional) If set, use this value for pool_timeout with SQLAlchemy.
# Defaults to $::os_service_default
#
class ec2api::db (
$database_connection = 'sqlite:////var/lib/ec2api/ec2api.sqlite',
$database_idle_timeout = $::os_service_default,
@ -47,6 +51,7 @@ class ec2api::db (
$database_max_retries = $::os_service_default,
$database_retry_interval = $::os_service_default,
$database_max_overflow = $::os_service_default,
$database_pool_timeout = $::os_service_default,
) {
include ::ec2api::deps
@ -62,6 +67,7 @@ class ec2api::db (
retry_interval => $database_retry_interval,
max_pool_size => $database_max_pool_size,
max_overflow => $database_max_overflow,
pool_timeout => $database_pool_timeout,
}
}

View File

@ -0,0 +1,5 @@
---
features:
- |
Adds the pool_timeout option for configuring oslo.db. This will
configure this value for pool_timeout with SQLAlchemy.

View File

@ -20,6 +20,7 @@ describe 'ec2api::db' do
:retry_interval => '<SERVICE DEFAULT>',
:max_pool_size => '<SERVICE DEFAULT>',
:max_overflow => '<SERVICE DEFAULT>',
:pool_timeout => '<SERVICE DEFAULT>',
}
it { is_expected.to contain_oslo__db('ec2api_config').with(parameters) }
@ -36,6 +37,7 @@ describe 'ec2api::db' do
:database_retry_interval => '4',
:database_max_pool_size => '5',
:database_max_overflow => '6',
:database_pool_timeout => '6',
}
end
@ -52,6 +54,7 @@ describe 'ec2api::db' do
:retry_interval => '4',
:max_pool_size => '5',
:max_overflow => '6',
:pool_timeout => '6',
}
it { is_expected.to contain_oslo__db('ec2api_config').with(parameters) }