From dd9c1879ae51b115168d77a20b465a8b41e54af2 Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Thu, 22 Mar 2018 11:09:50 +0800 Subject: [PATCH] Add pool_timeout option Add pool_timeout option to configure this value for pool_timeout with SQLAlchemy. Change-Id: I7d78a55b17b8609ec0d41dfc2dda8f0e0b85ce8f Closes-Bug: #1757581 --- manifests/db.pp | 6 ++++++ .../add-pool_timeout-option-for-db-a9c5bbeb7d243d5d.yaml | 5 +++++ spec/classes/nova_db_spec.rb | 2 ++ 3 files changed, 13 insertions(+) create mode 100644 releasenotes/notes/add-pool_timeout-option-for-db-a9c5bbeb7d243d5d.yaml 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 40fe4596a..0f2b38db7 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 overriden 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) }