Merge "TVD: configure the list of supported plugins"

This commit is contained in:
Zuul 2018-03-18 10:15:14 +00:00 committed by Gerrit Code Review
commit b3e9311686
2 changed files with 11 additions and 0 deletions

View File

@ -868,6 +868,12 @@ nsx_tvd_opts = [
choices=projectpluginmap.VALID_TYPES,
help=_("The default plugin that will be used for new projects "
"that were not added to the projects plugin mapping.")),
cfg.ListOpt('enabled_plugins',
default=[projectpluginmap.NsxPlugins.NSX_T,
projectpluginmap.NsxPlugins.NSX_V,
projectpluginmap.NsxPlugins.DVS],
help=_("The list of plugins that the TVD core plugin will "
"load")),
cfg.ListOpt('nsx_v_default_availability_zones',
default=[],
help=_("The default availability zones that will be used for "

View File

@ -126,6 +126,11 @@ class NsxTVDPlugin(agentschedulers_db.AZDhcpAgentSchedulerDbMixin,
return True
def _init_plugin(self, map_type, plugin_class):
if map_type not in cfg.CONF.nsx_tvd.enabled_plugins:
# skip this plugin
LOG.info("%s plugin was not enabled by the configuration",
map_type.upper())
return
try:
self.plugins[map_type] = plugin_class()
except Exception as e: