From a29a62a10eef22d33ae3df7ac099886ac02b4efa Mon Sep 17 00:00:00 2001 From: ZhongShengping Date: Thu, 23 Mar 2017 13:40:37 +0800 Subject: [PATCH] Deprecate sqlite_db option The configuration option ``sqlite_db`` is now deprecated and will be removed in the future. Please use configuration option ``connection`` or ``slave_connection`` to connect to the database. Change-Id: I637fff0deea04a1631f7c1eaa590999efa63a4c2 Closes-Bug: #1675252 --- manifests/db.pp | 20 +++++++++++++------ ...ate_config_sqlite_db-1a239175d42378e3.yaml | 7 +++++++ spec/defines/oslo_db_spec.rb | 1 - 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/deprecate_config_sqlite_db-1a239175d42378e3.yaml diff --git a/manifests/db.pp b/manifests/db.pp index 0e38026..0793412 100644 --- a/manifests/db.pp +++ b/manifests/db.pp @@ -7,10 +7,6 @@ # # === Parameters: # -# [*sqlite_db*] -# (Optional) The file name to use with SQLite. -# Defaults to $::os_service_default -# # [*sqlite_synchronous*] # (Optional) If True, SQLite uses synchronous mode (boolean value). # Defaults to $::os_service_default @@ -100,8 +96,13 @@ # (Optional) Enable the experimental use of thread pooling for all DB API calls (boolean value) # Defaults to $::os_service_default # +# DEPRECATED PARAMETERS +# +# [*sqlite_db*] +# (Optional) The file name to use with SQLite. +# Defaults to undef +# define oslo::db( - $sqlite_db = $::os_service_default, $sqlite_synchronous = $::os_service_default, $backend = $::os_service_default, $backend_package_ensure = present, @@ -123,6 +124,8 @@ define oslo::db( $db_max_retry_interval = $::os_service_default, $db_max_retries = $::os_service_default, $use_tpool = $::os_service_default, + # DEPRECATED PARAMETERS + $sqlite_db = undef, ){ include ::oslo::params @@ -166,8 +169,13 @@ define oslo::db( } } + if $sqlite_db { + warning("The sqlite_db parameter is now deprecated and will be removed in the \ +future release. Please use configuration option connection or slave_connection \ +to connect to the database.") + } + $database_options = { - 'database/sqlite_db' => { value => $sqlite_db }, 'database/sqlite_synchronous' => { value => $sqlite_synchronous }, 'database/backend' => { value => $backend }, 'database/connection' => { value => $connection, secret => true }, diff --git a/releasenotes/notes/deprecate_config_sqlite_db-1a239175d42378e3.yaml b/releasenotes/notes/deprecate_config_sqlite_db-1a239175d42378e3.yaml new file mode 100644 index 0000000..d20da8a --- /dev/null +++ b/releasenotes/notes/deprecate_config_sqlite_db-1a239175d42378e3.yaml @@ -0,0 +1,7 @@ +--- +deprecations: + - | + The configuration option ``sqlite_db`` is now deprecated and + will be removed in the future. Please use configuration + option ``connection`` or ``slave_connection`` to connect to the database. + diff --git a/spec/defines/oslo_db_spec.rb b/spec/defines/oslo_db_spec.rb index 77b3014..6daafc4 100644 --- a/spec/defines/oslo_db_spec.rb +++ b/spec/defines/oslo_db_spec.rb @@ -8,7 +8,6 @@ describe 'oslo::db' do context 'with default parameters' do it 'configure oslo_db default params' do - is_expected.to contain_keystone_config('database/sqlite_db').with_value('') is_expected.to contain_keystone_config('database/sqlite_synchronous').with_value('') is_expected.to contain_keystone_config('database/backend').with_value('') is_expected.to contain_keystone_config('database/connection').with_value('')