mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
addons: bridge: fix 'ifquery -c' 'bridge vid error' on vlan aware bridge port
Ticket: CM-11811 Reviewed By: roopa, julien Testing Done: used same configuration from ticket For a VLAN aware bridge, if 'bridge-pvid' is not configured, auto bridge iface bridge bridge-ports swp7 swp8 bridge-vids 1-200 bridge-vlan-aware yes '1' is would be running pvid and [2-200] would be running vids. While doing _query_check() we compare configred versus running vids excluding running 'pvid'. Configured vids here is [1-200] and running is [2-200], but instead of excluding running 'pvid' we used to exclued configured 'pvid' which is None in this case. Comparison used to fail because of this. This patch excludes running 'pvid' instead of configured 'pvid' during _query_check() This patch also fixes 'ifquery -c' error for bridge-pvid if configured under a port of vlan aware bridge This patch also avoids printing 'bridge-pvid' on 'ifquery -c' if bridge-pvid is not configured under vlan aware bridge port sample configuration: auto swp4 iface swp4 auto swp7 iface swp7 bridge-pvid 2 auto swp8 iface swp8 bridge-pvid 2 auto bridge iface bridge bridge-ports swp4 swp7 swp8 bridge-vids 1-200 bridge-pvid 20 bridge-vlan-aware yes sample output: root@dell-s3000-02:~# ifquery -c -a auto swp4 iface swp4 [pass] bridge-pvid 20 [pass] auto swp7 iface swp7 [pass] bridge-pvid 2 [pass] auto swp8 iface swp8 [pass] bridge-pvid 2 [pass] auto bridge iface bridge [pass] bridge-vlan-aware yes [pass] bridge-ports swp8 swp7 swp4 [pass] bridge-pvid 20 bridge-vids 1-200 [] Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
This commit is contained in:
@ -1611,18 +1611,22 @@ class bridge(moduleBase):
|
||||
{}).get('pvid')
|
||||
attr_name = 'bridge-pvid'
|
||||
pvid = ifaceobj.get_attr_value_first('bridge-pvid')
|
||||
if not pvid:
|
||||
pvid = self._get_bridge_pvid(bridgename, ifaceobj_getfunc)
|
||||
if pvid:
|
||||
if running_pvid and running_pvid == pvid:
|
||||
ifaceobjcurr.update_config_with_status(attr_name,
|
||||
if running_pvid and running_pvid == pvid:
|
||||
ifaceobjcurr.update_config_with_status(attr_name,
|
||||
running_pvid, 0)
|
||||
else:
|
||||
ifaceobjcurr.update_config_with_status(attr_name,
|
||||
else:
|
||||
ifaceobjcurr.update_config_with_status(attr_name,
|
||||
running_pvid, 1)
|
||||
elif not running_pvid or running_pvid != '1':
|
||||
ifaceobjcurr.status = ifaceStatus.ERROR
|
||||
ifaceobjcurr.status_str = 'bridge pvid error'
|
||||
else:
|
||||
pvid = self._get_bridge_pvid(bridgename, ifaceobj_getfunc)
|
||||
if pvid:
|
||||
if not running_pvid or running_pvid != pvid:
|
||||
ifaceobjcurr.status = ifaceStatus.ERROR
|
||||
ifaceobjcurr.status_str = 'bridge pvid error'
|
||||
elif not running_pvid or running_pvid != '1':
|
||||
ifaceobjcurr.status = ifaceStatus.ERROR
|
||||
ifaceobjcurr.status_str = 'bridge pvid error'
|
||||
|
||||
attr_name = 'bridge-vids'
|
||||
vids = ifaceobj.get_attr_value_first(attr_name)
|
||||
|
Reference in New Issue
Block a user