From afb367d954b9a2a2fc1731bc2398e1badbf6f8e9 Mon Sep 17 00:00:00 2001 From: Roopa Prabhu Date: Sun, 3 Apr 2016 15:31:34 -0700 Subject: [PATCH] ifupdownmain: bridgevlan: dont squash vlan iface_types with ifaces of the same name Ticket: CM-10051 Reviewed By: julien, nikhil Testing Done: tested that bridge vlan attributes get applied correctly + ran ssim test testifupdown2.py This was introduced by a patch that squashed multiple iface objects into a single object. That led to the below interfaces getting squashed into one. Which is not the right thing to do: {noformat} auto Newbr.325 iface Newbr.325 address 24.0.0.22/30 address 3101:abc:bcad:1::3/64 auto Newbr.325 vlan Newbr.325 bridge-igmp-querier-src 194.31.10.45 {noformat} The 'vlan Newbr.325' ifaceobject needs to be kept separately and it is of type BRIDGE_VLAN. so, this patch just makes sure these interfaces are kept separately in the squash function. Signed-off-by: Roopa Prabhu --- ifupdown/ifupdownmain.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ifupdown/ifupdownmain.py b/ifupdown/ifupdownmain.py index 0f6a019..d069f8e 100644 --- a/ifupdown/ifupdownmain.py +++ b/ifupdown/ifupdownmain.py @@ -696,7 +696,10 @@ class ifupdownMain(ifupdownBase): if ifaceobj.compare(currentifaceobjlist[0]): self.logger.warn('duplicate interface %s found' %ifaceobj.name) return - currentifaceobjlist[0].squash(ifaceobj) + if ifaceobj.type == ifaceType.BRIDGE_VLAN: + self.ifaceobjdict[ifaceobj.name].append(ifaceobj) + else: + currentifaceobjlist[0].squash(ifaceobj) def _save_iface(self, ifaceobj): if self._check_config_no_repeats(ifaceobj):