conf: Remove 'db_driver' config opt

This option has been deprecated for a long time and any kinks, where
they existed, should have long since been worked out. Time to kill it.

Change-Id: Ifa686b5ce5e8063a8e5f2f22c89124c1d4083b80
This commit is contained in:
Stephen Finucane 2017-09-29 11:56:13 +01:00 committed by Chris Dent
parent 7cbb5764d4
commit a3e9530fe9
4 changed files with 16 additions and 28 deletions

View File

@ -21,17 +21,6 @@ from nova.conf import paths
_DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('nova.sqlite')
# NOTE(sdague): we know of at least 1 instance of out of tree usage
# for this config in RAX. They used this because of performance issues
# with some queries. We think the right path forward is fixing the
# SQLA queries to be more performant for everyone.
db_driver_opt = cfg.StrOpt('db_driver',
default='nova.db',
deprecated_for_removal=True,
deprecated_since='13.0.0',
help='The driver to use for database access')
# NOTE(markus_z): We cannot simply do:
# conf.register_opts(oslo_db_options.database_opts, 'api_database')
# If we reuse a db config option for two different groups ("api_database"
@ -115,7 +104,6 @@ def enrich_help_text(alt_db_opts):
def register_opts(conf):
oslo_db_options.set_defaults(conf, connection=_DEFAULT_SQL_CONNECTION)
conf.register_opt(db_driver_opt)
conf.register_opts(api_db_opts, group=api_db_group)
@ -128,6 +116,6 @@ def list_opts():
# in the "sample.conf" file, I omit the listing of the "oslo_db_options"
# here.
enrich_help_text(api_db_opts)
return {'DEFAULT': [db_driver_opt],
api_db_group: api_db_opts,
}
return {
api_db_group: api_db_opts
}

View File

@ -14,21 +14,14 @@
# License for the specific language governing permissions and limitations
# under the License.
"""Base class for classes that need modular database access."""
"""Base class for classes that need database access."""
from oslo_utils import importutils
import nova.conf
CONF = nova.conf.CONF
import nova.db
class Base(object):
"""DB driver is injected in the init method."""
def __init__(self, db_driver=None):
def __init__(self):
super(Base, self).__init__()
if not db_driver:
db_driver = CONF.db_driver
self.db = importutils.import_module(db_driver)
self.db = nova.db

View File

@ -91,7 +91,7 @@ class ManagerMeta(profiler.get_traced_meta(), type(PeriodicTasks)):
class Manager(base.Base, PeriodicTasks):
__trace_args__ = {"name": "rpc"}
def __init__(self, host=None, db_driver=None, service_name='undefined'):
def __init__(self, host=None, service_name='undefined'):
if not host:
host = CONF.host
self.host = host
@ -99,7 +99,7 @@ class Manager(base.Base, PeriodicTasks):
self.service_name = service_name
self.notifier = rpc.get_notifier(self.service_name, self.host)
self.additional_endpoints = []
super(Manager, self).__init__(db_driver)
super(Manager, self).__init__()
def periodic_tasks(self, context, raise_on_error=False):
"""Tasks to be run at a periodic interval."""

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
The ``db_driver`` configuration option was deprecated in a previous release
and has now been removed. This option allowed you to replace the SQLAlchemy
database layer with one of your own. The approach was deprecated and
unsupported, and it is now time to remove it completely.