mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
Move LINK_MASTER/LINK_SLAVE to a new field link_type (purna hit some
issues with having it in flags) + add check for bond slave being already up Ticket: CM-4408 Reviewed By: Testing Done: some bond sanity test (cherry picked from commit 346b62a41fbf4521008cd8a9b0fa227e75a5d994)
This commit is contained in:
@@ -673,3 +673,15 @@ class iproute2(utilsBase):
|
||||
|
||||
def is_bridge(self, bridge):
|
||||
return os.path.exists('/sys/class/net/%s/bridge' %bridge)
|
||||
|
||||
def is_link_up(self, ifacename):
|
||||
ret = False
|
||||
try:
|
||||
flags = self.read_file_oneline('/sys/class/net/%s/flags' %ifacename)
|
||||
iflags = int(flags, 16)
|
||||
if (iflags & 0x0001):
|
||||
ret = True
|
||||
except:
|
||||
ret = False
|
||||
pass
|
||||
return ret
|
||||
|
||||
Reference in New Issue
Block a user