From cc64f7010522e812a696159009a72e59e2b017a8 Mon Sep 17 00:00:00 2001 From: "ChangBo Guo(gcb)" Date: Fri, 24 Mar 2017 14:08:07 +0800 Subject: Remove deprecated config option sqlite_db We deprecated config options sqlite_db in July, 2016 [1], and it shows up in many projects' config files but these projects don't use it either, so it's confusing to our users. It's time to remove it, just use config option connection or slave_connection to connect to the database. [1] https://review.openstack.org/#/c/338047/ Closes-Bug: #1329086 Change-Id: Id269d921e40edf95eb977b011f1753f633b79d18 --- oslo_db/options.py | 21 ++------------------- oslo_db/sqlalchemy/enginefacade.py | 3 +-- ...ve-config-option-sqlite_db-7b7c6459135fd8c9.yaml | 5 +++++ 3 files changed, 8 insertions(+), 21 deletions(-) create mode 100644 releasenotes/notes/remove-config-option-sqlite_db-7b7c6459135fd8c9.yaml diff --git a/oslo_db/options.py b/oslo_db/options.py index d5d15cf..1ce2381 100644 --- a/oslo_db/options.py +++ b/oslo_db/options.py @@ -10,18 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. -from debtcollector import removals from oslo_config import cfg database_opts = [ - cfg.StrOpt('sqlite_db', - deprecated_for_removal=True, - deprecated_reason='Should use config option connection or ' - 'slave_connection to connect the database.', - deprecated_group='DEFAULT', - default='oslo.sqlite', - help='The file name to use with SQLite.'), cfg.BoolOpt('sqlite_synchronous', deprecated_group='DEFAULT', default=True, @@ -143,12 +135,8 @@ database_opts = [ ] -@removals.removed_kwarg("sqlite_db", - "Config option sqlite_db is deprecated for removal," - "please use option `connection`.") -def set_defaults(conf, connection=None, sqlite_db=None, - max_pool_size=None, max_overflow=None, - pool_timeout=None): +def set_defaults(conf, connection=None, max_pool_size=None, + max_overflow=None, pool_timeout=None): """Set defaults for configuration variables. Overrides default options values. @@ -165,9 +153,6 @@ def set_defaults(conf, connection=None, sqlite_db=None, * sqlite:////absolute/path/to/file.db :type connection: str - :keyword sqlite_db: path to SQLite database file. - :type sqlite_db: str - :keyword max_pool_size: maximum connections pool size. The size of the pool to be maintained, defaults to 5. This is the largest number of connections that will be kept persistently in the pool. Note that the pool begins with @@ -200,8 +185,6 @@ def set_defaults(conf, connection=None, sqlite_db=None, if connection is not None: conf.set_default('connection', connection, group='database') - if sqlite_db is not None: - conf.set_default('sqlite_db', sqlite_db, group='database') if max_pool_size is not None: conf.set_default('max_pool_size', max_pool_size, group='database') if max_overflow is not None: diff --git a/oslo_db/sqlalchemy/enginefacade.py b/oslo_db/sqlalchemy/enginefacade.py index 2519668..88bca6b 100644 --- a/oslo_db/sqlalchemy/enginefacade.py +++ b/oslo_db/sqlalchemy/enginefacade.py @@ -169,8 +169,7 @@ class _TransactionFactory(object): 'db_max_retries', 'db_inc_retry_interval', 'use_db_reconnect', 'db_retry_interval', 'min_pool_size', - 'db_max_retry_interval', - 'sqlite_db', 'backend']) + 'db_max_retry_interval', 'backend']) self._started = False self._legacy_facade = None diff --git a/releasenotes/notes/remove-config-option-sqlite_db-7b7c6459135fd8c9.yaml b/releasenotes/notes/remove-config-option-sqlite_db-7b7c6459135fd8c9.yaml new file mode 100644 index 0000000..d8f10d0 --- /dev/null +++ b/releasenotes/notes/remove-config-option-sqlite_db-7b7c6459135fd8c9.yaml @@ -0,0 +1,5 @@ +--- +upgrade: + - The configuration option ``sqlite_db`` is removed. Pease use + configuration option ``connection`` or ``slave_connection`` + to connect to the database. -- cgit v1.2.1