Skip to content

Commit 615f277

Browse files
authored
[minigraph] Remove SLB and bgp monitor peers for storage backend (#12251)
Signed-off-by: Neetha John [email protected] Why I did it slb and bgp mon peers are not needed for storage backend. These neighbor are present in the minigraph. How I did it After minigraph parsing, remove these neighbors if it is a storage backend device How to verify it Unit tests Verified on the device that once these tables are removed, these peers don't show up in "show runningconfig bgp" output
1 parent 3cd9b2e commit 615f277

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/sonic-config-engine/minigraph.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,6 +1790,11 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
17901790
if is_storage_device:
17911791
results['DEVICE_METADATA']['localhost']['storage_device'] = "true"
17921792

1793+
# remove bgp monitor and slb peers for storage backend
1794+
if is_storage_device and 'BackEnd' in current_device['type']:
1795+
results['BGP_MONITORS'] = {}
1796+
results['BGP_PEER_RANGE'] = {}
1797+
17931798
results['VLAN'] = vlans
17941799
results['VLAN_MEMBER'] = vlan_members
17951800

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,14 @@ def verify_sub_intf(self, **kwargs):
804804
output = self.run_script(argument)
805805
self.assertEqual(output.strip(), "")
806806

807+
# SLB and BGP Monitor table does not exist
808+
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "BGP_PEER_RANGE"'
809+
output = self.run_script(argument)
810+
self.assertEqual(output.strip(), "{}")
811+
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "BGP_MONITORS"'
812+
output = self.run_script(argument)
813+
self.assertEqual(output.strip(), "{}")
814+
807815
# ACL_TABLE should not contain EVERFLOW related entries
808816
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "ACL_TABLE"'
809817
output = self.run_script(argument)
@@ -1021,4 +1029,4 @@ def test_minigraph_packet_chassis_400g_zr_port_config(self):
10211029
output = self.run_script(argument)
10221030
output_dict = utils.to_dict(output.strip())
10231031
self.assertEqual(output_dict['tx_power'], '7.5')
1024-
self.assertEqual(output_dict['laser_freq'], 131000)
1032+
self.assertEqual(output_dict['laser_freq'], 131000)

0 commit comments

Comments
 (0)