Merge "Update class params to os_service_default"

This commit is contained in:
Jenkins 2016-05-10 15:17:38 +00:00 committed by Gerrit Code Review
commit 9e12919982
3 changed files with 26 additions and 22 deletions

View File

@ -15,38 +15,38 @@
#
# [*database_idle_timeout*]
# Timeout when db connections should be reaped.
# (Optional) Defaults to 3600.
# (Optional) Defaults to $::os_service_default.
#
# [*database_min_pool_size*]
# Minimum number of SQL connections to keep open in a pool.
# (Optional) Defaults to $::os_service_default.
#
# [*database_max_pool_size*]
# Maximum number of SQL connections to keep open in a pool.
# (Optional) Defaults to $::os_service_default.
#
# [*database_max_retries*]
# Maximum number of database connection retries during startup.
# Setting -1 implies an infinite retry count.
# (Optional) Defaults to 10.
# (Optional) Defaults to $::os_service_default.
#
# [*database_retry_interval*]
# Interval between retries of opening a database connection.
# (Optional) Defaults to 10.
#
# [*database_min_pool_size*]
# Minimum number of SQL connections to keep open in a pool.
# (Optional) Defaults to 1.
#
# [*database_max_pool_size*]
# Maximum number of SQL connections to keep open in a pool.
# (Optional) Defaults to 10.
# (Optional) Defaults to $::os_service_default.
#
# [*database_max_overflow*]
# If set, use this value for max_overflow with sqlalchemy.
# (Optional) Defaults to 20.
# (Optional) Defaults to $::os_service_default.
#
class aodh::db (
$database_db_max_retries = $::os_service_default,
$database_connection = 'sqlite:////var/lib/aodh/aodh.sqlite',
$database_idle_timeout = 3600,
$database_min_pool_size = 1,
$database_max_pool_size = 10,
$database_max_retries = 10,
$database_retry_interval = 10,
$database_max_overflow = 20,
$database_idle_timeout = $::os_service_default,
$database_min_pool_size = $::os_service_default,
$database_max_pool_size = $::os_service_default,
$database_max_retries = $::os_service_default,
$database_retry_interval = $::os_service_default,
$database_max_overflow = $::os_service_default,
) {
$database_connection_real = pick($::aodh::database_connection, $database_connection)

View File

@ -0,0 +1,4 @@
---
upgrade:
- Updated the parameters for aodh::db class,
using the default fact $::os_service_default

View File

@ -7,10 +7,10 @@ describe 'aodh::db' do
context 'with default parameters' do
it { is_expected.to contain_aodh_config('database/db_max_retries').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_aodh_config('database/connection').with_value('sqlite:////var/lib/aodh/aodh.sqlite') }
it { is_expected.to contain_aodh_config('database/idle_timeout').with_value('3600') }
it { is_expected.to contain_aodh_config('database/min_pool_size').with_value('1') }
it { is_expected.to contain_aodh_config('database/max_retries').with_value('10') }
it { is_expected.to contain_aodh_config('database/retry_interval').with_value('10') }
it { is_expected.to contain_aodh_config('database/idle_timeout').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_aodh_config('database/min_pool_size').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_aodh_config('database/max_retries').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_aodh_config('database/retry_interval').with_value('<SERVICE DEFAULT>') }
end