diff --git a/neutron/db/api.py b/neutron/db/api.py index 4f813dd735..1e05361fac 100644 --- a/neutron/db/api.py +++ b/neutron/db/api.py @@ -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) - register_models() + 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): diff --git a/neutron/plugins/metaplugin/meta_neutron_plugin.py b/neutron/plugins/metaplugin/meta_neutron_plugin.py index 01f4941415..f65c523451 100644 --- a/neutron/plugins/metaplugin/meta_neutron_plugin.py +++ b/neutron/plugins/metaplugin/meta_neutron_plugin.py @@ -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: