diff --git a/devstack/lib/vmware_nsx_v3 b/devstack/lib/vmware_nsx_v3 index 49f5b95cd4..4884540b30 100644 --- a/devstack/lib/vmware_nsx_v3 +++ b/devstack/lib/vmware_nsx_v3 @@ -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." diff --git a/etc/nsx.ini b/etc/nsx.ini index 27983d4f9f..a94047601d 100644 --- a/etc/nsx.ini +++ b/etc/nsx.ini @@ -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 diff --git a/vmware_nsx/common/config.py b/vmware_nsx/common/config.py index 28ee6968a1..2fa8ee485b 100644 --- a/vmware_nsx/common/config.py +++ b/vmware_nsx/common/config.py @@ -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") diff --git a/vmware_nsx/services/l2gateway/common/plugin.py b/vmware_nsx/services/l2gateway/common/plugin.py index e92d0615d1..3d4e2647c8 100644 --- a/vmware_nsx/services/l2gateway/common/plugin.py +++ b/vmware_nsx/services/l2gateway/common/plugin.py @@ -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 diff --git a/vmware_nsx/tests/unit/vmware/services/l2gateway/test_nsxv3_driver.py b/vmware_nsx/tests/unit/vmware/services/l2gateway/test_nsxv3_driver.py index f3327dbd6d..a0b417cb76 100644 --- a/vmware_nsx/tests/unit/vmware/services/l2gateway/test_nsxv3_driver.py +++ b/vmware_nsx/tests/unit/vmware/services/l2gateway/test_nsxv3_driver.py @@ -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()