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:
parent
231913a153
commit
cc64f70105
@ -10,18 +10,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from debtcollector import removals
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
|
||||||
|
|
||||||
database_opts = [
|
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',
|
cfg.BoolOpt('sqlite_synchronous',
|
||||||
deprecated_group='DEFAULT',
|
deprecated_group='DEFAULT',
|
||||||
default=True,
|
default=True,
|
||||||
@ -143,12 +135,8 @@ database_opts = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@removals.removed_kwarg("sqlite_db",
|
def set_defaults(conf, connection=None, max_pool_size=None,
|
||||||
"Config option sqlite_db is deprecated for removal,"
|
max_overflow=None, pool_timeout=None):
|
||||||
"please use option `connection`.")
|
|
||||||
def set_defaults(conf, connection=None, sqlite_db=None,
|
|
||||||
max_pool_size=None, max_overflow=None,
|
|
||||||
pool_timeout=None):
|
|
||||||
"""Set defaults for configuration variables.
|
"""Set defaults for configuration variables.
|
||||||
|
|
||||||
Overrides default options values.
|
Overrides default options values.
|
||||||
@ -165,9 +153,6 @@ def set_defaults(conf, connection=None, sqlite_db=None,
|
|||||||
* sqlite:////absolute/path/to/file.db
|
* sqlite:////absolute/path/to/file.db
|
||||||
:type connection: str
|
: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
|
: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
|
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
|
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:
|
if connection is not None:
|
||||||
conf.set_default('connection', connection, group='database')
|
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:
|
if max_pool_size is not None:
|
||||||
conf.set_default('max_pool_size', max_pool_size, group='database')
|
conf.set_default('max_pool_size', max_pool_size, group='database')
|
||||||
if max_overflow is not None:
|
if max_overflow is not None:
|
||||||
|
@ -169,8 +169,7 @@ class _TransactionFactory(object):
|
|||||||
'db_max_retries', 'db_inc_retry_interval',
|
'db_max_retries', 'db_inc_retry_interval',
|
||||||
'use_db_reconnect',
|
'use_db_reconnect',
|
||||||
'db_retry_interval', 'min_pool_size',
|
'db_retry_interval', 'min_pool_size',
|
||||||
'db_max_retry_interval',
|
'db_max_retry_interval', 'backend'])
|
||||||
'sqlite_db', 'backend'])
|
|
||||||
|
|
||||||
self._started = False
|
self._started = False
|
||||||
self._legacy_facade = None
|
self._legacy_facade = None
|
||||||
|
@ -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.
|
Loading…
Reference in New Issue
Block a user