mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
ifupdown2: bridge: fix bridge-pvid under bridge 'notfound' during ifquery --check
Ticket: Reviewed By: Testing Done: Tested ifquery --check with bridge-pvid bridge-pvid and bridge-vids on a bridge does not correspond directly to a running config on the bridge. They correspond to default values for the bridge ports. And they are already checked against running config of the bridge port and reported against a bridge port. So, This patch ignores these attributes under the bridge. Uses '2' for ignore today. XXX: '2' will be mapped to a defined value in subsequent patches. Before: auto bridge iface bridge [fail] bridge-vlan-aware yes [pass] bridge-ports swp3 swp4 [pass] bridge-pvid notfound [fail] After: auto bridge iface bridge [pass] bridge-vlan-aware yes [pass] bridge-ports swp3 swp4 [pass] bridge-pvid 20 (cherry picked from commit 29e70abbf7920cf94c3ebd738dd757c2ca27b35c)
This commit is contained in:
committed by
Sam Tannous
parent
0582f185ed
commit
307e06bb2c
@@ -1405,7 +1405,19 @@ class bridge(moduleBase):
|
||||
pass
|
||||
ifaceobjcurr.update_config_with_status(k, currstr, status)
|
||||
elif not rv:
|
||||
ifaceobjcurr.update_config_with_status(k, 'notfound', 1)
|
||||
if k == 'bridge-pvid' or k == 'bridge-vids':
|
||||
# bridge-pvid and bridge-vids on a bridge does
|
||||
# not correspond directly to a running config
|
||||
# on the bridge. They correspond to default
|
||||
# values for the bridge ports. And they are
|
||||
# already checked against running config of the
|
||||
# bridge port and reported against a bridge port.
|
||||
# So, ignore these attributes under the bridge.
|
||||
# Use '2' for ignore today. XXX: '2' will be
|
||||
# mapped to a defined value in subsequent patches.
|
||||
ifaceobjcurr.update_config_with_status(k, v, 2)
|
||||
else:
|
||||
ifaceobjcurr.update_config_with_status(k, 'notfound', 1)
|
||||
continue
|
||||
elif v != rv:
|
||||
ifaceobjcurr.update_config_with_status(k, rv, 1)
|
||||
@@ -1428,6 +1440,8 @@ class bridge(moduleBase):
|
||||
pvid = None
|
||||
for ifaceobj in ifaceobjs:
|
||||
pvid = ifaceobj.get_attr_value_first('bridge-pvid')
|
||||
if pvid:
|
||||
break
|
||||
return pvid
|
||||
|
||||
def _get_bridge_name(self, ifaceobj):
|
||||
|
Reference in New Issue
Block a user