mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
Add rtnetlink api's for link creates
Ticket: CM-3346 Reviewed By: Testing Done:
This commit is contained in:
@@ -12,6 +12,7 @@ import subprocess
|
||||
import re
|
||||
import os
|
||||
from iface import *
|
||||
import rtnetlink_api as rtnetlink_api
|
||||
|
||||
class ifupdownBase(object):
|
||||
|
||||
@@ -65,7 +66,7 @@ class ifupdownBase(object):
|
||||
return os.path.exists('/sys/class/net/%s' %ifacename)
|
||||
|
||||
def link_up(self, ifacename):
|
||||
self.exec_command('ifconfig %s up' %ifacename)
|
||||
rtnetlink_api.rtnl_api.link_set(ifacename, "up")
|
||||
|
||||
def link_down(self, ifacename):
|
||||
self.exec_command('ifconfig %s down' %ifacename)
|
||||
rtnetlink_api.rtnl_api.link_set(ifacename, "down")
|
||||
|
Reference in New Issue
Block a user