Skip to content

Commit

Permalink
Update SmartSwitch config to align YANG standard (sonic-net#21110)
Browse files Browse the repository at this point in the history
Fixes: sonic-net#20730

Why I did it
The generated t1 config fails YANG validation, which leads to config setup failure since we enforce YANG validation in config reload.

How I did it
Update config to align with YANG

How to verify it
Run YANG validate on generated config.
  • Loading branch information
wen587 authored and VladimirKuk committed Jan 21, 2025
1 parent 9561ed1 commit 20d3a68
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
10 changes: 6 additions & 4 deletions src/sonic-config-engine/config_samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ def generate_t1_smartswitch_switch_sample_config(data, ss_config):

bridge_name = 'bridge-midplane'

data['MID_PLANE_BRIDGE'] = {
"GLOBAL": {
"bridge": bridge_name,
"ip_prefix": "169.254.200.254/24"
}
}
dhcp_server_ports = {}

for dpu_name in natsorted(ss_config.get('DPUS', {})):
Expand Down Expand Up @@ -122,10 +128,6 @@ def generate_t1_smartswitch_switch_sample_config(data, ss_config):

data['DHCP_SERVER_IPV4'] = {
bridge_name: {
'customized_options': [
'option60',
'option223'
],
'gateway': mpbr_address,
'lease_time': '3600',
'mode': 'PORT',
Expand Down
10 changes: 6 additions & 4 deletions src/sonic-config-engine/tests/sample_output/t1-smartswitch.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,6 @@
"DEVICE_NEIGHBOR": {},
"DHCP_SERVER_IPV4": {
"bridge-midplane": {
"customized_options": [
"option60",
"option223"
],
"gateway": "169.254.200.254",
"lease_time": "3600",
"mode": "PORT",
Expand Down Expand Up @@ -415,6 +411,12 @@
"LOOPBACK_INTERFACE": {
"Loopback0|10.1.0.1/32": {}
},
"MID_PLANE_BRIDGE": {
"GLOBAL": {
"bridge": "bridge-midplane",
"ip_prefix": "169.254.200.254/24"
}
},
"PORT": {
"Ethernet0": {
"admin_status": "up",
Expand Down

0 comments on commit 20d3a68

Please sign in to comment.