Skip to content

Commit d1f307d

Browse files
authored
[GCU]Fix rdma check failure (sonic-net#2824)
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
1 parent ce81a34 commit d1f307d

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

generic_config_updater/field_operation_validators.py

+1-17
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,8 @@
33

44
def rdma_config_update_validator():
55
version_info = device_info.get_sonic_version_info()
6-
build_version = version_info.get('build_version')
76
asic_type = version_info.get('asic_type')
87

98
if (asic_type != 'mellanox' and asic_type != 'broadcom' and asic_type != 'cisco-8000'):
109
return False
11-
12-
version_substrings = build_version.split('.')
13-
branch_version = None
14-
15-
for substring in version_substrings:
16-
if substring.isdigit() and re.match(r'^\d{8}$', substring):
17-
branch_version = substring
18-
break
19-
20-
if branch_version is None:
21-
return False
22-
23-
if asic_type == 'cisco-8000':
24-
return branch_version >= "20201200"
25-
else:
26-
return branch_version >= "20181100"
10+
return True

0 commit comments

Comments
 (0)