mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
Added ifupdown support for different lacp bypass modes
Ticket: CM-5716 Reviewed By: Testing Done: Added mode to distinguish between priority based and multiple links lacp bypass modes.
This commit is contained in:
@@ -54,7 +54,7 @@ class ifenslaveutil(utilsBase):
|
||||
%(bondname, x))),
|
||||
['use_carrier', 'miimon', 'min_links', 'num_unsol_na',
|
||||
'num_grat_arp', 'lacp_bypass_allow', 'lacp_bypass_period',
|
||||
'clag_enable'])
|
||||
'lacp_bypass_use_priority', 'clag_enable'])
|
||||
except Exception, e:
|
||||
pass
|
||||
|
||||
@@ -318,6 +318,26 @@ class ifenslaveutil(utilsBase):
|
||||
prio_str = ' '.join(prios)
|
||||
return prio_str
|
||||
|
||||
def set_lacp_fallback_use_priority(self, bondname, useprio, prehook=None, posthook=None):
|
||||
if (self._cache_check([bondname, 'linkinfo', 'lacp_bypass_use_priority'],
|
||||
lacp_bypass_use_priority)):
|
||||
return
|
||||
if prehook:
|
||||
prehook(bondname)
|
||||
try:
|
||||
self.write_file('/sys/class/net/%s' %bondname +
|
||||
'/bonding/lacp_bypass_use_priority', useprio)
|
||||
except:
|
||||
raise
|
||||
finally:
|
||||
if posthook:
|
||||
posthook(bondname)
|
||||
self._cache_update([bondname, 'linkinfo',
|
||||
'lacp_bypass_use_priority'], useprio)
|
||||
|
||||
def get_lacp_fallback_use_priority(self, bondname):
|
||||
return self._cache_get([bondname, 'linkinfo', 'lacp_bypass_use_priority'])
|
||||
|
||||
def get_ad_sys_mac_addr(self, bondname):
|
||||
return self._cache_get([bondname, 'linkinfo', 'ad_sys_mac_addr'])
|
||||
|
||||
|
Reference in New Issue
Block a user