Merge "Remove global DB_ENGINE from Neutron"
This commit is contained in:
commit
0316852e63
@ -25,7 +25,6 @@ from neutron.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
_DB_ENGINE = None
|
||||
BASE = model_base.BASEV2
|
||||
|
||||
|
||||
@ -35,17 +34,13 @@ def configure_db():
|
||||
Establish the database, create an engine if needed, and register
|
||||
the models.
|
||||
"""
|
||||
global _DB_ENGINE
|
||||
if not _DB_ENGINE:
|
||||
_DB_ENGINE = session.get_engine(sqlite_fk=True)
|
||||
session.get_engine(sqlite_fk=True)
|
||||
register_models()
|
||||
|
||||
|
||||
def clear_db(base=BASE):
|
||||
global _DB_ENGINE
|
||||
unregister_models(base)
|
||||
session.cleanup()
|
||||
_DB_ENGINE = None
|
||||
|
||||
|
||||
def get_session(autocommit=True, expire_on_commit=False):
|
||||
|
@ -73,8 +73,6 @@ class MetaPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
in cfg.CONF.META.plugin_list.split(',')]
|
||||
for flavor, plugin_provider in plugin_list:
|
||||
self.plugins[flavor] = self._load_plugin(plugin_provider)
|
||||
# Needed to clear _DB_ENGINE for each plugin
|
||||
db._DB_ENGINE = None
|
||||
|
||||
self.l3_plugins = {}
|
||||
l3_plugin_list = [plugin_set.split(':')
|
||||
@ -86,7 +84,6 @@ class MetaPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
else:
|
||||
# For l3 only plugin
|
||||
self.l3_plugins[flavor] = self._load_plugin(plugin_provider)
|
||||
db._DB_ENGINE = None
|
||||
|
||||
self.default_flavor = cfg.CONF.META.default_flavor
|
||||
if self.default_flavor not in self.plugins:
|
||||
|
Loading…
Reference in New Issue
Block a user