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

[GCU]Remove GCU unique lane check for duplicate lanes platforms #2343

Merged
merged 9 commits into from
Sep 20, 2022
Merged
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
22 changes: 15 additions & 7 deletions generic_config_updater/gu_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,21 @@ def validate_lanes(self, config_db):
port_to_lanes_map[port] = lanes

# Validate lanes are unique
existing = {}
for port in port_to_lanes_map:
lanes = port_to_lanes_map[port]
for lane in lanes:
if lane in existing:
return False, f"'{lane}' lane is used multiple times in PORT: {set([port, existing[lane]])}"
existing[lane] = port
# TODO: Move this attribute (platform with duplicated lanes in ports) to YANG models
dup_lanes_platforms = [
'x86_64-arista_7050cx3_32s',
'x86_64-dellemc_s5232f_c3538-r0',
]
metadata = config_db.get("DEVICE_METADATA", {})
platform = metadata.get("localhost", {}).get("platform", None)
if platform not in dup_lanes_platforms:
existing = {}
for port in port_to_lanes_map:
lanes = port_to_lanes_map[port]
for lane in lanes:
if lane in existing:
return False, f"'{lane}' lane is used multiple times in PORT: {set([port, existing[lane]])}"
existing[lane] = port
return True, None

def validate_bgp_peer_group(self, config_db):
Expand Down