when handling mstpctl attribute on vlan-unaware bridges we don't
check the running configuration of the bridge ports (cache) thus
misconfiguring some attributes on brports.
We first create a traditional bridge with:
auto bridge1
iface bridge1
bridge-ports swp1 swp2
bridge-vlan-aware no
We check the setting:
$ mstpctl showportdetail bridge1 swp1 | grep edge
admin edge port no auto edge port yes
oper edge port yes topology change ack no
We then add the setting for swp1:
auto swp1
iface swp1
mstpctl-portautoedge no
We then do an ifreload -adv and we see two calls. First
info: executing /sbin/mstpctl setportautoedge bridge1 swp1 no
and then a little later
info: executing /sbin/mstpctl setportautoedge bridge1 swp1 yes
Reviewed-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
if not self.brctlcmd.is_bridge_port(port):
continue
- bport_ifaceobj = ifaceobj_getfunc(port)
- if bport_ifaceobj:
- default_val = self._get_default_val(attrname, bport_ifaceobj[0], ifaceobj)
+ bport_ifaceobjs = ifaceobj_getfunc(port)
+ if bport_ifaceobjs:
+ default_val = self._get_default_val(attrname, bport_ifaceobjs[0], ifaceobj)
+ for brport_ifaceobj in bport_ifaceobjs or []:
+ attr_value = brport_ifaceobj.get_attr_value_first(attrname)
+ if attr_value:
+ default_val = attr_value
+ break
self.mstpctlcmd.set_bridge_port_attr(ifaceobj.name,
port,