]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
addons: vxlan: support for vxlan-support-mix-dev-types policy (default yes)
authorJulien Fortin <jfortin@nvidia.com>
Tue, 15 Jun 2021 15:39:40 +0000 (17:39 +0200)
committerJulien Fortin <jfortin@nvidia.com>
Thu, 1 Jul 2021 17:08:55 +0000 (19:08 +0200)
Signed-off-by: Julien Fortin <jfortin@nvidia.com>
ifupdown2/addons/vxlan.py

index 0447f4ea42aee919694c9ccefbfff11db5f5fe13..9c672bec9ba5973f197566d52768c82a6bac7c01 100644 (file)
@@ -170,6 +170,14 @@ class vxlan(Vxlan, moduleBase):
             attr="vxlan-physdev-mcastgrp"
         ) or self.VXLAN_PHYSDEV_MCASTGRP_DEFAULT
 
+        self.tvd_svd_mix_support = utils.get_boolean_from_string(
+            policymanager.policymanager_api.get_module_globals(
+                module_name=self.__class__.__name__,
+                attr="vxlan-support-mix-dev-types"
+            ),
+            default=True
+        )
+
         self.svd_tvd_errors = {}
 
     def reset(self):
@@ -182,6 +190,9 @@ class vxlan(Vxlan, moduleBase):
             if not ifaceobj.get_attr_value_first('vxlan-local-tunnelip') and not self._vxlan_local_tunnelip:
                 self.logger.warning('%s: missing vxlan-local-tunnelip' % ifaceobj.name)
                 return False
+
+            self.check_and_raise_svd_tvd_errors(ifaceobj)
+
             return self.syntax_check_localip_anycastip_equal(
                 ifaceobj.name,
                 ifaceobj.get_attr_value_first('vxlan-local-tunnelip') or self._vxlan_local_tunnelip,
@@ -207,7 +218,7 @@ class vxlan(Vxlan, moduleBase):
             ifaceobj.link_kind |= ifaceLinkKind.VXLAN
             self._set_global_local_ip(ifaceobj)
 
-            if not old_ifaceobjs:
+            if not old_ifaceobjs and not self.tvd_svd_mix_support:
                 # mixing TVD and SVD is not supported - we need to warn the user
                 # we use a dictionary to make sure to only warn once and prevent each
                 # vxlan from being configured on the system