diff --git a/manifests/db.pp b/manifests/db.pp index cac25fe3c..501a0d1a2 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -75,6 +75,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 nova::db ( $database_db_max_retries = $::os_service_default, $database_connection = $::os_service_default, @@ -89,6 +93,7 @@ class nova::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 ::nova::deps @@ -130,6 +135,7 @@ class nova::db ( max_retries => $database_max_retries_real, retry_interval => $database_retry_interval_real, max_overflow => $database_max_overflow_real, + pool_timeout => $database_pool_timeout, slave_connection => $slave_connection_real, } } diff --git a/releasenotes/notes/add-pool_timeout-option-for-db-a9c5bbeb7d243d5d.yaml b/releasenotes/notes/add-pool_timeout-option-for-db-a9c5bbeb7d243d5d.yaml new file mode 100644 index 000000000..be3038910 --- /dev/null +++ b/releasenotes/notes/add-pool_timeout-option-for-db-a9c5bbeb7d243d5d.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Adds the pool_timeout option for configuring oslo.db. This will + configure this value for pool_timeout with SQLAlchemy. diff --git a/spec/classes/nova_db_spec.rb b/spec/classes/nova_db_spec.rb index 3ffacddad..4e6e383ae 100644 --- a/spec/classes/nova_db_spec.rb +++ b/spec/classes/nova_db_spec.rb @@ -22,6 +22,7 @@ describe 'nova::db' do it { is_expected.to_not contain_nova_config('database/max_retries') } it { is_expected.to_not contain_nova_config('database/retry_interval') } it { is_expected.to_not contain_nova_config('database/max_overflow') } + it { is_expected.to_not contain_nova_config('database/pool_timeout') } end context 'with overridden parameters' do @@ -46,6 +47,7 @@ describe 'nova::db' do :max_retries => '', :retry_interval => '', :max_overflow => '', + :pool_timeout => '', )} 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/slave_connection').with_value('mysql+pymysql://user:pass@slave/db2').with_secret(true) }