1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

Move clag_enable setting to ifupdown2 ifenslave.

Ticket: CM-4802
Reviewed By:
Testing Done: yes

1. clag_enable needs to be set before slaves are added to the bond. Otherwise
bonding driver will bring the slaves up independent of clagd.
2. also added post_down clagd addon to cleanup the clag-id on ifdown.
This commit is contained in:
anuradhak
2015-02-02 09:54:53 -08:00
parent 67b8126335
commit ff01349dd4
3 changed files with 22 additions and 1 deletions

View File

@@ -53,7 +53,8 @@ class ifenslaveutil(utilsBase):
self.read_file_oneline('/sys/class/net/%s/bonding/%s'
%(bondname, x))),
['use_carrier', 'miimon', 'min_links', 'num_unsol_na',
'num_grat_arp', 'lacp_bypass_allow', 'lacp_bypass_period'])
'num_grat_arp', 'lacp_bypass_allow', 'lacp_bypass_period',
'clag_enable'])
except Exception, e:
pass
@@ -191,6 +192,18 @@ class ifenslaveutil(utilsBase):
def get_miimon(self, bondname):
return self._cache_get([bondname, 'linkinfo', 'miimon'])
def set_clag_enable(self, bondname, clag_id):
clag_enable = '0' if clag_id == '0' else '1'
if self._cache_check([bondname, 'linkinfo', 'clag_enable'],
clag_enable) == False:
self.write_file('/sys/class/net/%s' %bondname +
'/bonding/clag_enable', clag_enable)
self._cache_update([bondname, 'linkinfo', 'clag_enable'],
clag_enable)
def get_clag_enable(self, bondname):
return self._cache_get([bondname, 'linkinfo', 'clag_enable'])
def set_mode(self, bondname, mode, prehook=None):
valid_modes = ['balance-rr', 'active-backup', 'balance-xor',
'broadcast', '802.3ad', 'balance-tlb', 'balance-alb']