Move nsx_l2gw_driver to DEFAULT section in nsx.ini

Currently the nsx_l2gw_driver option exists in the base_opts in
config, which mostly belongs to NSX-MH. This patch proposes to move
it under DEFAULT section.

Change-Id: I0884f420debe14355d8bc0cf66ff2a418b2d4d78
This commit is contained in:
Abhishek Raut 2015-08-22 02:00:02 -07:00
parent d5593953a7
commit 7c450bbaef
5 changed files with 14 additions and 10 deletions

View File

@ -111,7 +111,7 @@ function neutron_plugin_configure_service {
die $LINENO "The VMware NSX plugin needs at least an NSX controller."
fi
if [[ "$NSX_L2GW_DRIVER" != "" ]]; then
iniset /$Q_PLUGIN_CONF_FILE nsx nsx_l2gw_driver $NSX_L2GW_DRIVER
iniset /$Q_PLUGIN_CONF_FILE DEFAULT nsx_l2gw_driver $NSX_L2GW_DRIVER
fi
_nsxv3_ini_set default_tier0_router_uuid $DEFAULT_TIER0_ROUTER_UUID
_nsxv3_ini_set nsx_manager $NSX_MANAGER "The VMWare NSX plugin needs a NSX manager."

View File

@ -44,6 +44,10 @@
# Reconnect connection to nsx if not used within this amount of time.
# conn_idle_timeout = 900
# Specify the class path for the Layer 2 gateway backend driver(i.e. NSXv3/NSX-V).
# This field will be used when a L2 Gateway service plugin is configured.
# nsx_l2gw_driver =
[quotas]
# number of network gateways allowed per tenant, -1 means unlimited
# quota_network_gateway = 5
@ -225,10 +229,6 @@
# "service".
# replication_mode = service
# Specify the class path for the Layer 2 gateway backend driver(i.e. NSXv3/NSX-V).
# This field will be used when a L2 Gateway service plugin is configured.
# nsx_l2gw_driver = vmware_nsx.services.l2gateway.nsx_v3.driver.NsxV3Driver
[nsx_sync]
# Interval in seconds between runs of the status synchronization task.
# The plugin will aim at resynchronizing operational status for all

View File

@ -79,8 +79,6 @@ base_opts = [
" if one does not want to deploy a service node(s). "
"It must be set to 'service' for leveraging distributed "
"routers.")),
cfg.StrOpt('nsx_l2gw_driver',
help=_("Class path for the L2 gateway backend driver"))
]
sync_opts = [
@ -160,6 +158,11 @@ cluster_opts = [
"network connection")),
]
nsx_common_opts = [
cfg.StrOpt('nsx_l2gw_driver',
help=_("Class path for the L2 gateway backend driver"))
]
nsx_v3_opts = [
cfg.StrOpt('nsx_user',
default='admin',
@ -327,6 +330,7 @@ nsxv_opts = [
# Register the configuration options
cfg.CONF.register_opts(connection_opts)
cfg.CONF.register_opts(cluster_opts)
cfg.CONF.register_opts(nsx_common_opts)
cfg.CONF.register_opts(nsx_v3_opts, group="nsx_v3")
cfg.CONF.register_opts(nsxv_opts, group="nsxv")
cfg.CONF.register_opts(base_opts, group="NSX")

View File

@ -44,9 +44,9 @@ class NsxL2GatewayPlugin(l2gateway_db.L2GatewayMixin):
"""Initialize service plugin and load backend driver."""
super(NsxL2GatewayPlugin, self).__init__()
LOG.debug("Starting service plugin for NSX L2Gateway")
self._nsx_l2gw_driver = cfg.CONF.NSX.nsx_l2gw_driver
self._nsx_l2gw_driver = cfg.CONF.nsx_l2gw_driver
if not getattr(self, "_nsx_l2gw_driver"):
raise cfg.RequiredOptError("nsx_l2gw_driver", "NSX")
raise cfg.RequiredOptError("nsx_l2gw_driver")
self._driver = importutils.import_object(self._nsx_l2gw_driver)
@staticmethod

View File

@ -44,7 +44,7 @@ class TestNsxV3L2GatewayDriver(test_l2gw_db.L2GWTestCase,
def setUp(self):
super(TestNsxV3L2GatewayDriver, self).setUp()
cfg.CONF.set_override("nsx_l2gw_driver",
NSX_V3_L2GW_DRIVER_CLASS_PATH, 'NSX')
NSX_V3_L2GW_DRIVER_CLASS_PATH)
self.core_plugin = importutils.import_object(NSX_V3_PLUGIN_CLASS)
self.l2gw_plugin = l2gw_plugin.NsxL2GatewayPlugin()
self.driver = nsx_v3_driver.NsxV3Driver()