Skip to content

Commit

Permalink
[GCU]Remove GCU unique lane check for duplicate lanes platforms (#2343)
Browse files Browse the repository at this point in the history
What I did
Remove unique lane check for specific platforms to unblock GCU nightly test.

How I did it
Add platform check for unique lane validator

How to verify it
Run unit test
  • Loading branch information
wen587 authored Sep 20, 2022
1 parent 7099fff commit 322aefc
Showing 1 changed file with 15 additions and 7 deletions.
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

0 comments on commit 322aefc

Please sign in to comment.