Skip to content

Commit

Permalink
resolve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
wen587 committed Sep 19, 2022
1 parent 1f6d114 commit 6cb3a8c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions generic_config_updater/gu_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,9 @@ def validate_sonic_yang_config(self, sonic_yang_as_json):
def validate_config_db_config(self, config_db_as_json):
sy = self.create_sonic_yang_with_loaded_models()

dup_lanes_platforms = [
'x86_64-arista_7050cx3_32s',
'x86_64-dellemc_s5232f_c3538-r0',
]
# TODO: Move these validators to YANG models
supplemental_yang_validators = [
self.validate_bgp_peer_group,
lambda config_db: self.validate_lanes(config_db, dup_lanes_platforms=dup_lanes_platforms)]
supplemental_yang_validators = [self.validate_bgp_peer_group,
self.validate_lanes]

try:
tmp_config_db_as_json = copy.deepcopy(config_db_as_json)
Expand All @@ -138,7 +133,7 @@ def validate_config_db_config(self, config_db_as_json):

return True, None

def validate_lanes(self, config_db, dup_lanes_platforms=[]):
def validate_lanes(self, config_db):
if "PORT" not in config_db:
return True, None

Expand All @@ -160,6 +155,10 @@ def validate_lanes(self, config_db, dup_lanes_platforms=[]):
port_to_lanes_map[port] = lanes

# Validate lanes are unique
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:
Expand Down

0 comments on commit 6cb3a8c

Please sign in to comment.