Skip to content

Commit

Permalink
[GCU]Fix rdma check failure (#2824)
Browse files Browse the repository at this point in the history
What I did
if substring.isdigit() and re.match(r'^\d{8}$', substring): In this version check, it only applies to this pattern: 20220531.XXX. It will fail the master and other build check. For example, master.261851-010dc3957 is a master build_version string. It will fail version validation and return failure.

My thought to remove the check is that GCU is only supported in 202205 and later. Either branch_version >= "20201200" or branch_version >= "20181100" is already satisfied.

How I did it
Remove redundant check in GCU RDMA validator

How to verify it
Unit test
  • Loading branch information
wen587 authored and yxieca committed May 17, 2023
1 parent e2f0f2c commit 14b2150
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions generic_config_updater/field_operation_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,8 @@

def rdma_config_update_validator():
version_info = device_info.get_sonic_version_info()
build_version = version_info.get('build_version')
asic_type = version_info.get('asic_type')

if (asic_type != 'mellanox' and asic_type != 'broadcom' and asic_type != 'cisco-8000'):
return False

version_substrings = build_version.split('.')
branch_version = None

for substring in version_substrings:
if substring.isdigit() and re.match(r'^\d{8}$', substring):
branch_version = substring
break

if branch_version is None:
return False

if asic_type == 'cisco-8000':
return branch_version >= "20201200"
else:
return branch_version >= "20181100"
return True

0 comments on commit 14b2150

Please sign in to comment.