]> git.proxmox.com Git - mirror_ifupdown2.git/commitdiff
addons: link: use iproute2 to create custom devices (fixes #156)
authorJulien Fortin <julien@cumulusnetworks.com>
Fri, 15 May 2020 15:49:56 +0000 (17:49 +0200)
committerJulien Fortin <julien@cumulusnetworks.com>
Fri, 15 May 2020 15:49:56 +0000 (17:49 +0200)
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
ifupdown2/addons/link.py
ifupdown2/lib/iproute2.py

index a7923915ee4735cb55d951bd96a10d2e7ce01e59..0d66f31abc455ea801051923e1513f863f8980c9 100644 (file)
@@ -100,7 +100,7 @@ class link(Addon, moduleBase):
                 self.iproute2.link_add_veth(ifaceobj.name, peer_name)
 
         elif link_type:
-            self.netlink.link_add(ifname=ifaceobj.name, kind=link_type)
+            self.iproute2.link_add(ifaceobj.name, link_type)
 
     def _down(self, ifaceobj):
         if not ifaceobj.get_attr_value_first('link-type'):
index ee26c36c5d44c3c3dd027a9d8a8819794fdc0bb8..77d45d793ee8f4747d38f175c2eaaef3a6bd6d70 100644 (file)
@@ -254,6 +254,14 @@ class IPRoute2(Cache, Requirements):
 
     ###
 
+    def link_add(self, ifname, link_type):
+        utils.exec_command(
+            "%s link add %s type %s"
+            % (utils.ip_cmd, ifname, link_type)
+        )
+
+    ###
+
     def link_add_macvlan(self, ifname, macvlan_ifname, macvlan_mode):
         utils.exec_command(
             "%s link add link %s name %s type macvlan mode %s"