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

Replace bond-slave "link down" with "link protodown" for CLAG bond proto_down

handling.

Ticket: CM-4802
Reviewed By: CCR-2565
Testing Done: Yes

1. Earlier various clag components where using link admin state for enforcing
proto_down. With the introduction of a seperate proto_down state this is no
longer needed. Now on clag bond "proto_down" the bond and its slaves are
explicitly placed in a proto_down state. This carrier downs the slaves and
oper-downs the clag-bond. Change has been done in clagd, clag-monit script and
bonding driver.
2. Earlier misc tricks where needed in ifupdown2 to prevent slave state changes
for clag bond outside of clagd. These tricks are no longer needed and have been
reverted to keep ifupdown2 handling simple/consistent. This change basically
reverts #6985e1a376b538fbfa2346ef657427ae7e8f117a.
This commit is contained in:
anuradhak
2015-02-18 08:03:07 -08:00
parent b6c1f5513a
commit fa6a36a90d

View File

@@ -121,11 +121,7 @@ class ifenslave(moduleBase):
# Also save a copy for future use
ifaceobj.priv_data = list(slave_list)
# if clag-id is non-zero then clagd controls the slave states
attrval = ifaceobj.get_attr_value_first('clag-id')
clag_id = attrval if attrval else '0'
if (ifaceobj.link_type != ifaceLinkType.LINK_NA or
clag_id != '0'):
if ifaceobj.link_type != ifaceLinkType.LINK_NA:
ifaceobj.link_type = ifaceLinkType.LINK_MASTER
return slave_list
@@ -228,8 +224,6 @@ class ifenslave(moduleBase):
[ self.ifenslavecmd.remove_slave(ifaceobj.name, s)
for s in runningslaves if s not in slaves ]
attrval = ifaceobj.get_attr_value_first('clag-id')
clag_id = attrval if attrval else '0'
for slave in Set(slaves).difference(Set(runningslaves)):
if not self.PERFMODE and not self.ipcmd.link_exists(slave):
self.log_warn('%s: skipping slave %s, does not exist'
@@ -240,9 +234,7 @@ class ifenslave(moduleBase):
rtnetlink_api.rtnl_api.link_set(slave, "down")
link_up = True
self.ipcmd.link_set(slave, 'master', ifaceobj.name)
# for clag bonds clagd controls the state of the clag slaves
if clag_id == '0' and (link_up or\
ifaceobj.link_type != ifaceLinkType.LINK_NA):
if link_up or ifaceobj.link_type != ifaceLinkType.LINK_NA:
rtnetlink_api.rtnl_api.link_set(slave, "up")
def _set_clag_enable(self, ifaceobj):