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

vlan: query_check: check vlan-protocol for not dotted interface

/etc/network/interfaces
-----------------------
auto eth0.100
iface eth0.100
        vlan-protocol 802.1ad

current
-------
ifquery -a -c

auto eth0.100
iface eth0.100                                                      [pass]

new
---
ifquery -a -c

auto eth0.100
iface eth0.100                                                      [pass]
        vlan-protocol 802.1ad                                       [pass]
This commit is contained in:
Alexandre Derumier
2023-04-20 11:48:11 +02:00
parent 1d6a726e5a
commit 3fee068a67

View File

@ -224,10 +224,13 @@ class vlan(Addon, moduleBase):
def _query_check(self, ifaceobj, ifaceobjcurr):
if not self.cache.link_exists(ifaceobj.name):
return
ifname = ifaceobj.name
cached_vlan_info_data = self.cache.get_link_info_data(ifname)
if '.' not in ifaceobj.name:
# if vlan name is not in the dot format, check its running state
ifname = ifaceobj.name
cached_vlan_raw_device = self.cache.get_lower_device_ifname(ifname)
#
@ -239,8 +242,6 @@ class vlan(Addon, moduleBase):
cached_vlan_raw_device != ifaceobj.get_attr_value_first('vlan-raw-device')
)
cached_vlan_info_data = self.cache.get_link_info_data(ifname)
#
# vlan-id
#
@ -252,27 +253,28 @@ class vlan(Addon, moduleBase):
cached_vlan_id_str = str(cached_vlan_id)
ifaceobjcurr.update_config_with_status('vlan-id', cached_vlan_id_str, vlanid_config != cached_vlan_id_str)
#
# vlan-protocol
#
protocol_config = ifaceobj.get_attr_value_first('vlan-protocol')
if protocol_config:
#
# vlan-protocol (dot or not dot format)
#
protocol_config = ifaceobj.get_attr_value_first('vlan-protocol')
if protocol_config:
cached_vlan_protocol = cached_vlan_info_data.get(Link.IFLA_VLAN_PROTOCOL)
cached_vlan_protocol = cached_vlan_info_data.get(Link.IFLA_VLAN_PROTOCOL)
if protocol_config.upper() != cached_vlan_protocol.upper():
ifaceobjcurr.update_config_with_status(
'vlan-protocol',
cached_vlan_protocol,
1
)
else:
ifaceobjcurr.update_config_with_status(
'vlan-protocol',
protocol_config,
0
)
if protocol_config.upper() != cached_vlan_protocol.upper():
ifaceobjcurr.update_config_with_status(
'vlan-protocol',
cached_vlan_protocol,
1
)
else:
ifaceobjcurr.update_config_with_status(
'vlan-protocol',
protocol_config,
0
)
if '.' not in ifaceobj.name:
#
# vlan-bridge-binding
#