Merge "Add support for db_max_retries param"
This commit is contained in:
@@ -21,6 +21,11 @@
|
|||||||
#
|
#
|
||||||
# == Parameters
|
# == Parameters
|
||||||
#
|
#
|
||||||
|
# [*database_db_max_retries*]
|
||||||
|
# (optional) Maximum retries in case of connection error or deadlock error
|
||||||
|
# before error is raised. Set to -1 to specify an infinite retry count.
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
# [*database_connection*]
|
# [*database_connection*]
|
||||||
# (optional) Connection url to connect to nova database.
|
# (optional) Connection url to connect to nova database.
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
@@ -63,6 +68,7 @@
|
|||||||
# (Optional) Defaults to $::os_service_default
|
# (Optional) Defaults to $::os_service_default
|
||||||
#
|
#
|
||||||
class nova::db (
|
class nova::db (
|
||||||
|
$database_db_max_retries = $::os_service_default,
|
||||||
$database_connection = $::os_service_default,
|
$database_connection = $::os_service_default,
|
||||||
$slave_connection = $::os_service_default,
|
$slave_connection = $::os_service_default,
|
||||||
$api_database_connection = $::os_service_default,
|
$api_database_connection = $::os_service_default,
|
||||||
@@ -97,6 +103,7 @@ class nova::db (
|
|||||||
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
'^(sqlite|mysql(\+pymysql)?|postgresql):\/\/(\S+:\S+@\S+\/\S+)?')
|
||||||
|
|
||||||
oslo::db { 'nova_config':
|
oslo::db { 'nova_config':
|
||||||
|
db_max_retries => $database_db_max_retries,
|
||||||
connection => $database_connection_real,
|
connection => $database_connection_real,
|
||||||
idle_timeout => $database_idle_timeout_real,
|
idle_timeout => $database_idle_timeout_real,
|
||||||
min_pool_size => $database_min_pool_size_real,
|
min_pool_size => $database_min_pool_size_real,
|
||||||
|
@@ -9,6 +9,7 @@ describe 'nova::db' do
|
|||||||
shared_examples 'nova::db' do
|
shared_examples 'nova::db' do
|
||||||
|
|
||||||
context 'with default parameters' do
|
context 'with default parameters' do
|
||||||
|
it { is_expected.to_not contain_nova_config('database/db_max_retries') }
|
||||||
it { is_expected.to_not contain_nova_config('database/connection') }
|
it { is_expected.to_not contain_nova_config('database/connection') }
|
||||||
it { is_expected.to_not contain_nova_config('database/slave_connection') }
|
it { is_expected.to_not contain_nova_config('database/slave_connection') }
|
||||||
it { is_expected.to_not contain_nova_config('api_database/connection') }
|
it { is_expected.to_not contain_nova_config('api_database/connection') }
|
||||||
@@ -29,6 +30,7 @@ describe 'nova::db' do
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it { is_expected.to contain_nova_config('database/db_max_retries').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_nova_config('database/connection').with_value('mysql+pymysql://user:pass@db/db1').with_secret(true) }
|
it { is_expected.to contain_nova_config('database/connection').with_value('mysql+pymysql://user:pass@db/db1').with_secret(true) }
|
||||||
it { is_expected.to contain_nova_config('database/slave_connection').with_value('mysql+pymysql://user:pass@slave/db1').with_secret(true) }
|
it { is_expected.to contain_nova_config('database/slave_connection').with_value('mysql+pymysql://user:pass@slave/db1').with_secret(true) }
|
||||||
it { is_expected.to contain_nova_config('api_database/connection').with_value('mysql+pymysql://user:pass@db/db2').with_secret(true) }
|
it { is_expected.to contain_nova_config('api_database/connection').with_value('mysql+pymysql://user:pass@db/db2').with_secret(true) }
|
||||||
|
Reference in New Issue
Block a user