Merge "Do not load default service plugins if core plugin is not DB based" into stable/pike

This commit is contained in:
Zuul 2017-11-22 23:06:06 +00:00 committed by Gerrit Code Review
commit 8484a25c74
3 changed files with 15 additions and 1 deletions

View File

@ -143,6 +143,9 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
__native_pagination_support = True
__native_sorting_support = True
def has_native_datastore(self):
return True
def __new__(cls, *args, **kwargs):
model_query.register_hook(
models_v2.Port,

View File

@ -179,7 +179,11 @@ class NeutronManager(object):
def _get_default_service_plugins(self):
"""Get default service plugins to be loaded."""
return constants.DEFAULT_SERVICE_PLUGINS.keys()
core_plugin = directory.get_plugin()
if core_plugin.has_native_datastore():
return constants.DEFAULT_SERVICE_PLUGINS.keys()
else:
return []
def _load_service_plugins(self):
"""Loads service plugins.

View File

@ -410,3 +410,10 @@ class NeutronPluginBaseV2(base_services.WorkerBase):
"""
return (self.__class__.start_rpc_state_reports_listener !=
NeutronPluginBaseV2.start_rpc_state_reports_listener)
def has_native_datastore(self):
"""Return True if the plugin uses Neutron's native datastore.
.. note:: plugins like ML2 should override this method and return True.
"""
return False