]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
openvswitch : manually add link to cache after creation
authorAlexandre Derumier <aderumier@odiso.com>
Mon, 17 Feb 2020 11:53:16 +0000 (12:53 +0100)
committerAlexandre Derumier <aderumier@odiso.com>
Mon, 17 Feb 2020 11:54:38 +0000 (12:54 +0100)
ifupdown2/addons/openvswitch.py
ifupdown2/addons/openvswitch_port.py
ifupdown2/lib/iproute2.py
ifupdown2/nlmanager/nlpacket.py

index 5f26b03342b0ae61d31cf6cbb01f4a6b2d6f66df..767d09a14df285ed312451e6dc5ca2756d2cf89c 100644 (file)
@@ -162,6 +162,8 @@ class openvswitch(Addon, moduleBase):
             cmd_list.append(cmd)
 
         self._ovs_vsctl(ifaceobj, cmd_list)
+        if not self.cache.link_exists(ifaceobj.name):
+            self.iproute2.link_add_openvswitch(ifaceobj.name, "openvswitch")
 
     def _delbridge (self, ifaceobj):
 
index 394ed663f034e2eea60f3eaf830d5c824960f74a..6acbece4a770fcb7b08487e71db2ff16aa8509dd 100644 (file)
@@ -200,6 +200,8 @@ class openvswitch_port(Addon, moduleBase):
             cmd_list.extend(ovsextra)
 
         self._ovs_vsctl(ifaceobj, cmd_list)
+        if not self.cache.link_exists(ifaceobj.name):
+            self.iproute2.link_add_openvswitch(ifaceobj.name, "openvswitch")
 
     def _delport (self, ifaceobj):
         iface = ifaceobj.name
index 12d14f54fb2d5342755943cb445eef39f5e10360..7872d09c85956311916026546e4a3c4a04199543 100644 (file)
@@ -337,6 +337,9 @@ class IPRoute2(Cache, Requirements):
         utils.exec_commandl(['ip', 'link', 'add', xfrm_name, 'type', 'xfrm', 'dev', ifname, 'if_id', xfrm_id])
         self.__update_cache_after_link_creation(xfrm_name, "xfrm")
 
+    def link_add_openvswitch(self, ifname, kind):
+        self.__update_cache_after_link_creation(ifname, kind)
+
     ############################################################################
     # TUNNEL
     ############################################################################
index 3dd31513fd7e46b137804b79a7e375e7767f1a71..d3cae39d796530ad8092be8828cd076398077512 100644 (file)
@@ -2759,7 +2759,8 @@ class AttributeIFLA_LINKINFO(Attribute):
             "ip6tnl",
             "ip6ip6",
             "ipip6",
-            "xfrm"
+            "xfrm",
+            "openvswitch"
 
         ):
             self.log.debug('Unsupported IFLA_INFO_KIND %s' % kind)