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
This commit is contained in:
ChangBo Guo(gcb) 2017-03-24 14:08:07 +08:00
parent 231913a153
commit cc64f70105
3 changed files with 8 additions and 21 deletions

View File

@ -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:

View File

@ -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

View File

@ -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.