Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minigraph] Remove SLB and bgp monitor peers for storage backend #12251

Merged
merged 2 commits into from
Oct 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,6 +1790,11 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
if is_storage_device:
results['DEVICE_METADATA']['localhost']['storage_device'] = "true"

# remove bgp monitor and slb peers for storage backend
if is_storage_device and 'BackEnd' in current_device['type']:
results['BGP_MONITORS'] = {}
results['BGP_PEER_RANGE'] = {}

results['VLAN'] = vlans
results['VLAN_MEMBER'] = vlan_members

Expand Down
10 changes: 9 additions & 1 deletion src/sonic-config-engine/tests/test_cfggen.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,14 @@ def verify_sub_intf(self, **kwargs):
output = self.run_script(argument)
self.assertEqual(output.strip(), "")

# SLB and BGP Monitor table does not exist
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "BGP_PEER_RANGE"'
output = self.run_script(argument)
self.assertEqual(output.strip(), "{}")
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "BGP_MONITORS"'
output = self.run_script(argument)
self.assertEqual(output.strip(), "{}")

# ACL_TABLE should not contain EVERFLOW related entries
argument = '-m "' + graph_file + '" -p "' + self.port_config + '" -v "ACL_TABLE"'
output = self.run_script(argument)
Expand Down Expand Up @@ -1021,4 +1029,4 @@ def test_minigraph_packet_chassis_400g_zr_port_config(self):
output = self.run_script(argument)
output_dict = utils.to_dict(output.strip())
self.assertEqual(output_dict['tx_power'], '7.5')
self.assertEqual(output_dict['laser_freq'], 131000)
self.assertEqual(output_dict['laser_freq'], 131000)