From 8e94ec92250d0794f59827deeac76e340497d108 Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Thu, 19 Dec 2019 21:10:55 +0000 Subject: [PATCH] Fix deprecation warning in glance-api.conf Beginning with the Queens release of OpenStack, idle_timeout in the database config group has been deprecated in favour of connection_recycle_time. Starting with Queens, the database type also changed from 'mysql' to 'mysql+pymysql'. This patch uses the context for database type to also determine idle_timeout vs. connection_recycle_time Change-Id: I875e54bbb0c43a9ad1b7f35c8d17939ca7739244 Closes-Bug: 1857041 --- templates/parts/section-database | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/parts/section-database b/templates/parts/section-database index de4c1e9d..ad76e7e3 100644 --- a/templates/parts/section-database +++ b/templates/parts/section-database @@ -1,5 +1,9 @@ {% if database_host -%} [database] connection = {{ database_type }}://{{ database_user }}:{{ database_password }}@{{ database_host }}/{{ database }}{% if database_ssl_ca %}?ssl_ca={{ database_ssl_ca }}{% if database_ssl_cert %}&ssl_cert={{ database_ssl_cert }}&ssl_key={{ database_ssl_key }}{% endif %}{% endif %} +{% if database_type == "mysql" -%} idle_timeout = 3600 +{% else -%} +connection_recycle_time = 3600 +{% endif -%} {% endif -%}