Skip to content

Commit 1b99c60

Browse files
authored
[202012] [minigraph] Remove SLB and bgp monitor peers for storage backend (sonic-net#12262)
Why I did it This is to backport sonic-net#12251 to 202012 Signed-off-by: Neetha John <[email protected]>
1 parent 3d8fbf4 commit 1b99c60

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/sonic-config-engine/minigraph.py

+5
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,11 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
15951595
if is_storage_device:
15961596
results['DEVICE_METADATA']['localhost']['storage_device'] = "true"
15971597

1598+
# remove bgp monitor and slb peers for storage backend
1599+
if is_storage_device and 'BackEnd' in current_device['type']:
1600+
results['BGP_MONITORS'] = {}
1601+
results['BGP_PEER_RANGE'] = {}
1602+
15981603
results['VLAN'] = vlans
15991604
results['VLAN_MEMBER'] = vlan_members
16001605

src/sonic-config-engine/tests/test_cfggen.py

+8
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,14 @@ def verify_sub_intf(self, **kwargs):
767767
output = self.run_script(argument)
768768
self.assertEqual(output.strip(), "")
769769

770+
# SLB and BGP Monitor table does not exist
771+
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "BGP_PEER_RANGE"'
772+
output = self.run_script(argument)
773+
self.assertEqual(output.strip(), "{}")
774+
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "BGP_MONITORS"'
775+
output = self.run_script(argument)
776+
self.assertEqual(output.strip(), "{}")
777+
770778
# ACL_TABLE should not contain EVERFLOW related entries
771779
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "ACL_TABLE"'
772780
output = self.run_script(argument)

0 commit comments

Comments
 (0)