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

Test Yang Validations #18391

Closed
wants to merge 5 commits into from
Closed
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
16 changes: 16 additions & 0 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,6 +1907,14 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
port['mtu'] = '9100'
port['tpid'] = '0x8100'

# mode check for vlan membership in PORT table default mode is routed and for vlan membership it is trunk
for port_name, port in ports.items():
if 'mode' not in port:
if port_name in [key[1] for key in vlan_members.keys()]:
port['mode'] = 'trunk'
else:
port['mode'] = 'routed'

# asymmetric PFC is disabled by default
for port in ports.values():
port['pfc_asym'] = 'off'
Expand Down Expand Up @@ -1977,6 +1985,14 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw
pc['mtu'] = '9100'
pc['tpid'] = '0x8100'
pc['admin_status'] = 'up'

# mode check for vlan membership in portchannel and default mode is routed and mode is trunk when portchannel has vlan membership with it
for pc_name, pc in pcs.items():
if 'mode' not in pc:
if pc_name in [key[1] for key in vlan_members.keys()]:
pc['mode'] = 'trunk'
else:
pc['mode'] = 'routed'

results['PORTCHANNEL'] = pcs
results['PORTCHANNEL_MEMBER'] = pc_members
Expand Down
Loading
Loading