mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
fix kernel lacp_fallback_* sysfs file references to use lacp_bypass_*
Ticket: Reviewed By: Testing Done: Build and sanity test
This commit is contained in:
committed by
Jonathan Toppins
parent
ff3bdefff7
commit
caac3e369d
@@ -172,10 +172,10 @@ class ifenslave(moduleBase):
|
|||||||
('bond-num-unsol-na' , 'num_unsol_na'),
|
('bond-num-unsol-na' , 'num_unsol_na'),
|
||||||
('bond-ad-sys-mac-addr' , 'ad_sys_mac_addr'),
|
('bond-ad-sys-mac-addr' , 'ad_sys_mac_addr'),
|
||||||
('bond-ad-sys-priority' , 'ad_sys_priority'),
|
('bond-ad-sys-priority' , 'ad_sys_priority'),
|
||||||
('bond-lacp-fallback-allow', 'lacp_fallback_allow'),
|
('bond-lacp-fallback-allow', 'lacp_bypass_allow'),
|
||||||
('bond-lacp-fallback-period', 'lacp_fallback_period'),
|
('bond-lacp-fallback-period', 'lacp_bypass_period'),
|
||||||
('bond-lacp-bypass-allow', 'lacp_fallback_allow'),
|
('bond-lacp-bypass-allow', 'lacp_bypass_allow'),
|
||||||
('bond-lacp-bypass-period', 'lacp_fallback_period')])
|
('bond-lacp-bypass-period', 'lacp_bypass_period')])
|
||||||
linkup = self.ipcmd.is_link_up(ifaceobj.name)
|
linkup = self.ipcmd.is_link_up(ifaceobj.name)
|
||||||
try:
|
try:
|
||||||
# order of attributes set matters for bond, so
|
# order of attributes set matters for bond, so
|
||||||
|
@@ -52,7 +52,7 @@ class ifenslaveutil(utilsBase):
|
|||||||
self.read_file_oneline('/sys/class/net/%s/bonding/%s'
|
self.read_file_oneline('/sys/class/net/%s/bonding/%s'
|
||||||
%(bondname, x))),
|
%(bondname, x))),
|
||||||
['use_carrier', 'miimon', 'min_links', 'num_unsol_na',
|
['use_carrier', 'miimon', 'min_links', 'num_unsol_na',
|
||||||
'num_grat_arp', 'lacp_fallback_allow', 'lacp_fallback_period'])
|
'num_grat_arp', 'lacp_bypass_allow', 'lacp_bypass_period'])
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -231,44 +231,44 @@ class ifenslaveutil(utilsBase):
|
|||||||
return self._cache_get([bondname, 'linkinfo', 'lacp_rate'])
|
return self._cache_get([bondname, 'linkinfo', 'lacp_rate'])
|
||||||
|
|
||||||
def set_lacp_fallback_allow(self, bondname, allow, prehook=None, posthook=None):
|
def set_lacp_fallback_allow(self, bondname, allow, prehook=None, posthook=None):
|
||||||
if (self._cache_check([bondname, 'linkinfo', 'lacp_fallback_allow'],
|
if (self._cache_check([bondname, 'linkinfo', 'lacp_bypass_allow'],
|
||||||
lacp_fallback_allow)):
|
lacp_bypass_allow)):
|
||||||
return
|
return
|
||||||
if prehook:
|
if prehook:
|
||||||
prehook(bondname)
|
prehook(bondname)
|
||||||
try:
|
try:
|
||||||
self.write_file('/sys/class/net/%s' %bondname +
|
self.write_file('/sys/class/net/%s' %bondname +
|
||||||
'/bonding/lacp_fallback_allow', allow)
|
'/bonding/lacp_bypass_allow', allow)
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
if posthook:
|
if posthook:
|
||||||
posthook(bondname)
|
posthook(bondname)
|
||||||
self._cache_update([bondname, 'linkinfo',
|
self._cache_update([bondname, 'linkinfo',
|
||||||
'lacp_fallback_allow'], allow)
|
'lacp_bypass_allow'], allow)
|
||||||
|
|
||||||
def get_lacp_fallback_allow(self, bondname):
|
def get_lacp_fallback_allow(self, bondname):
|
||||||
return self._cache_get([bondname, 'linkinfo', 'lacp_fallback_allow'])
|
return self._cache_get([bondname, 'linkinfo', 'lacp_bypass_allow'])
|
||||||
|
|
||||||
def set_lacp_fallback_period(self, bondname, period, prehook=None, posthook=None):
|
def set_lacp_fallback_period(self, bondname, period, prehook=None, posthook=None):
|
||||||
if (self._cache_check([bondname, 'linkinfo', 'lacp_fallback_period'],
|
if (self._cache_check([bondname, 'linkinfo', 'lacp_bypass_period'],
|
||||||
lacp_fallback_period)):
|
lacp_bypass_period)):
|
||||||
return
|
return
|
||||||
if prehook:
|
if prehook:
|
||||||
prehook(bondname)
|
prehook(bondname)
|
||||||
try:
|
try:
|
||||||
self.write_file('/sys/class/net/%s' %bondname +
|
self.write_file('/sys/class/net/%s' %bondname +
|
||||||
'/bonding/lacp_fallback_period', period)
|
'/bonding/lacp_bypass_period', period)
|
||||||
except:
|
except:
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
if posthook:
|
if posthook:
|
||||||
posthook(bondname)
|
posthook(bondname)
|
||||||
self._cache_update([bondname, 'linkinfo',
|
self._cache_update([bondname, 'linkinfo',
|
||||||
'lacp_fallback_period'], period)
|
'lacp_bypass_period'], period)
|
||||||
|
|
||||||
def get_lacp_fallback_period(self, bondname):
|
def get_lacp_fallback_period(self, bondname):
|
||||||
return self._cache_get([bondname, 'linkinfo', 'lacp_fallback_period'])
|
return self._cache_get([bondname, 'linkinfo', 'lacp_bypass_period'])
|
||||||
|
|
||||||
def set_min_links(self, bondname, min_links, prehook=None):
|
def set_min_links(self, bondname, min_links, prehook=None):
|
||||||
if (self._cache_check([bondname, 'linkinfo', 'min_links'],
|
if (self._cache_check([bondname, 'linkinfo', 'min_links'],
|
||||||
@@ -284,7 +284,7 @@ class ifenslaveutil(utilsBase):
|
|||||||
return self._cache_get([bondname, 'linkinfo', 'min_links'])
|
return self._cache_get([bondname, 'linkinfo', 'min_links'])
|
||||||
|
|
||||||
def set_lacp_fallback_priority(self, bondname, port, val):
|
def set_lacp_fallback_priority(self, bondname, port, val):
|
||||||
slavefile = '/sys/class/net/%s/bonding_slave/lacp_fallback_priority' %port
|
slavefile = '/sys/class/net/%s/bonding_slave/lacp_bypass_priority' %port
|
||||||
if os.path.exists(slavefile):
|
if os.path.exists(slavefile):
|
||||||
self.write_file(slavefile, val)
|
self.write_file(slavefile, val)
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ class ifenslaveutil(utilsBase):
|
|||||||
return slaves
|
return slaves
|
||||||
prios = []
|
prios = []
|
||||||
for slave in slaves:
|
for slave in slaves:
|
||||||
priofile = '/sys/class/net/%s/bonding_slave/lacp_fallback_priority' %slave
|
priofile = '/sys/class/net/%s/bonding_slave/lacp_bypass_priority' %slave
|
||||||
if os.path.exists(priofile):
|
if os.path.exists(priofile):
|
||||||
val = self.read_file_oneline(priofile)
|
val = self.read_file_oneline(priofile)
|
||||||
if val and val != '0':
|
if val and val != '0':
|
||||||
|
Reference in New Issue
Block a user