[minigraph] No longer generate the “members” field on the VLAN table in ConfigDB (#9237)

#### Why I did it
This field is deprecated.
Fixes https://github.com/Azure/sonic-buildimage/issues/8306
Fixes https://github.com/Azure/sonic-buildimage/issues/9121
This commit is contained in:
Qi Luo 2021-11-18 18:03:11 -08:00 committed by GitHub
parent da1503d7be
commit 06bf76b5bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -531,6 +531,7 @@ def parse_dpg(dpg, hname):
vlanintfs = child.find(str(QName(ns, "VlanInterfaces"))) vlanintfs = child.find(str(QName(ns, "VlanInterfaces")))
vlans = {} vlans = {}
vlan_members = {} vlan_members = {}
vlan_member_list = {}
dhcp_relay_table = {} dhcp_relay_table = {}
vlantype_name = "" vlantype_name = ""
intf_vlan_mbr = defaultdict(list) intf_vlan_mbr = defaultdict(list)
@ -558,7 +559,7 @@ def parse_dpg(dpg, hname):
else: else:
vlan_members[(sonic_vlan_member_name, vmbr_list[i])] = {'tagging_mode': 'untagged'} vlan_members[(sonic_vlan_member_name, vmbr_list[i])] = {'tagging_mode': 'untagged'}
vlan_attributes = {'vlanid': vlanid, 'members': vmbr_list } vlan_attributes = {'vlanid': vlanid}
dhcp_attributes = {} dhcp_attributes = {}
# If this VLAN requires a DHCP relay agent, it will contain a <DhcpRelays> element # If this VLAN requires a DHCP relay agent, it will contain a <DhcpRelays> element
@ -586,6 +587,7 @@ def parse_dpg(dpg, hname):
if sonic_vlan_name != vintfname: if sonic_vlan_name != vintfname:
vlan_attributes['alias'] = vintfname vlan_attributes['alias'] = vintfname
vlans[sonic_vlan_name] = vlan_attributes vlans[sonic_vlan_name] = vlan_attributes
vlan_member_list[sonic_vlan_name] = vmbr_list
acls = {} acls = {}
for aclintf in aclintfs.findall(str(QName(ns, "AclInterface"))): for aclintf in aclintfs.findall(str(QName(ns, "AclInterface"))):
@ -616,7 +618,7 @@ def parse_dpg(dpg, hname):
elif member in vlans: elif member in vlans:
# For egress ACL attaching to vlan, we break them into vlan members # For egress ACL attaching to vlan, we break them into vlan members
if stage == "egress": if stage == "egress":
acl_intfs.extend(vlans[member]['members']) acl_intfs.extend(vlan_member_list[member])
else: else:
acl_intfs.append(member) acl_intfs.append(member)
elif member in port_alias_map: elif member in port_alias_map:

View File

@ -245,10 +245,10 @@ class TestCfgGen(TestCase):
self.assertEqual( self.assertEqual(
utils.to_dict(output.strip()), utils.to_dict(output.strip()),
utils.to_dict( utils.to_dict(
"{'Vlan1000': {'alias': 'ab1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '1000', 'members': ['Ethernet8']}, " "{'Vlan1000': {'alias': 'ab1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '1000'}, "
"'Vlan2001': {'alias': 'ab3', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '2001', 'members': ['Ethernet12']}," "'Vlan2001': {'alias': 'ab3', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '2001'},"
"'Vlan2000': {'alias': 'ab2', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '2000', 'members': ['Ethernet12']}," "'Vlan2000': {'alias': 'ab2', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '2000'},"
"'Vlan2020': {'alias': 'kk1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '2020', 'members': ['Ethernet12']}}" "'Vlan2020': {'alias': 'kk1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2'], 'vlanid': '2020'}}"
) )
) )

View File

@ -105,13 +105,11 @@ class TestCfgGenCaseInsensitive(TestCase):
'dhcpv6_servers': ['fc02:2000::1', 'fc02:2000::2'], 'dhcpv6_servers': ['fc02:2000::1', 'fc02:2000::2'],
'vlanid': '1000', 'vlanid': '1000',
'mac': '00:aa:bb:cc:dd:ee', 'mac': '00:aa:bb:cc:dd:ee',
'members': ['Ethernet8']
}, },
'Vlan2000': { 'Vlan2000': {
'alias': 'ab2', 'alias': 'ab2',
'dhcp_servers': ['192.0.0.1'], 'dhcp_servers': ['192.0.0.1'],
'dhcpv6_servers': ['fc02:2000::3', 'fc02:2000::4'], 'dhcpv6_servers': ['fc02:2000::3', 'fc02:2000::4'],
'members': ['Ethernet4'],
'vlanid': '2000' 'vlanid': '2000'
} }
} }