NSX|P: Use policy api for ipv6 routing global config

Change-Id: I8d8e3d676ee1794c2a601052526a2ecac10deeae
This commit is contained in:
asarfaty 2019-11-24 11:40:36 +02:00 committed by Adit Sarfaty
parent c2c671c518
commit dea5fdfb3a

View File

@ -257,15 +257,22 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
LOG.error(msg)
raise n_exc.InvalidInput(error_message=msg)
def _init_default_config(self):
def _enable_ipv6_routing(self):
# Ipv6 is disabled by default in NSX and should be enabled
if self.nsxpolicy.feature_supported(
nsxlib_consts.FEATURE_NSX_POLICY_GLOBAL_CONFIG):
self.nsxpolicy.global_config.enable_ipv6()
return
# Ipv6 is disabled by default in NSX
if cfg.CONF.nsx_p.allow_passthrough:
self.nsxlib.global_routing.enable_ipv6()
else:
LOG.warning("Unable to switch on Ipv6 forwarding. Ipv6 "
"connectivity might be broken.")
# Default tier0/transport zones are initialized via the default AZ
def _init_default_config(self):
self._enable_ipv6_routing()
# Validate other mandatory configuration
if cfg.CONF.nsx_p.allow_passthrough: