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

[DPB] fix optional fields for child ports in scope DPB #1492

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
9 changes: 7 additions & 2 deletions config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2382,9 +2382,14 @@ def breakout(ctx, interface_name, mode, verbose, force_remove_dependencies, load
if not _validate_interface_mode(ctx, breakout_cfg_file, interface_name, mode, cur_brkout_mode):
raise click.Abort()

# Get hwsku dict from hwsku.json file
_, hwsku_path = device_info.get_paths_to_platform_and_hwsku_dirs()
hwsku_filepath = os.path.join(hwsku_path, "hwsku.json")
hwsku_dict = readJsonFile(hwsku_filepath)

""" Interface Deletion Logic """
# Get list of interfaces to be deleted
del_ports = get_child_ports(interface_name, cur_brkout_mode, breakout_cfg_file)
del_ports = get_child_ports(interface_name, cur_brkout_mode, breakout_cfg_file, hwsku_dict)
del_intf_dict = {intf: del_ports[intf]["speed"] for intf in del_ports}

if del_intf_dict:
Expand All @@ -2400,7 +2405,7 @@ def breakout(ctx, interface_name, mode, verbose, force_remove_dependencies, load

""" Interface Addition Logic """
# Get list of interfaces to be added
add_ports = get_child_ports(interface_name, target_brkout_mode, breakout_cfg_file)
add_ports = get_child_ports(interface_name, target_brkout_mode, breakout_cfg_file, hwsku_dict)
add_intf_dict = {intf: add_ports[intf]["speed"] for intf in add_ports}

if add_intf_dict:
Expand Down