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

ifupdownmain: redo shared dependent checks

Ticket: CM-10027
Reviewed By: julien, nikhil
Testing Done: Tested with an interfaces file with shared dependents

In the process of fixing this saw a few more issues with link kind
handing. Its better to separate kind from interface private flags
like bond slave and bridge port. this patch cleans up all that handling.

Example errors:
error: misconfig..? swp5.2 vrfslave  is enslaved to multiple interfaces
['vrf1012', 'br2']
error: misconfig..? swp5.2 bridgeport  is enslaved to multiple
interfaces ['vrf1012', 'br2']
This commit is contained in:
Roopa Prabhu
2016-03-30 11:54:58 -07:00
parent 9219cef3d6
commit 858a230f91
5 changed files with 85 additions and 35 deletions

View File

@@ -244,7 +244,8 @@ class bridge(moduleBase):
ifaceobj.link_kind |= ifaceLinkKind.BRIDGE
# for special vlan aware bridges, we need to add another bit
if ifaceobj.get_attr_value_first('bridge-vlan-aware') == 'yes':
ifaceobj.link_kind |= ifaceLinkKind.BRIDGE_VLAN_AWARE
ifaceobj.link_kind |= ifaceLinkKind.BRIDGE
ifaceobj.link_privflags |= ifaceLinkPrivFlags.BRIDGE_VLAN_AWARE
ifaceobj.role |= ifaceRole.MASTER
ifaceobj.dependency_type = ifaceDependencyType.MASTER_SLAVE
return self.parse_port_list(ifaceobj.name,
@@ -987,7 +988,7 @@ class bridge(moduleBase):
add_port = False
bridgename = self.ipcmd.bridge_port_get_bridge_name(ifaceobj.name)
if (not bridgename and
(ifaceobj.link_kind & ifaceLinkKind.BRIDGE_PORT)):
(ifaceobj.link_privflags & ifaceLinkPrivFlags.BRIDGE_PORT)):
# get bridgename and add port to bridge
bridgename = self._get_bridgename(ifaceobj)
add_port = True