Skip to content

Commit 5031d8b

Browse files
committed
reorg
1 parent 76a90ce commit 5031d8b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

generic_config_updater/field_operation_validators.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010

1111
def get_asic_name():
1212
asic = "unknown"
13-
command = ["sudo", "lspci"]
14-
hwsku = device_info.get_hwsku()
15-
proc = subprocess.Popen(command, universal_newlines=True, stdout=subprocess.PIPE)
16-
proc.communicate()
17-
output = proc.stdout.readlines()
18-
13+
1914
if device_info.get_sonic_version_info()['asic_type'] == 'cisco-8000':
2015
asic = "cisco-8000"
21-
elif proc.returncode == 0:
16+
else:
17+
command = ["sudo", "lspci"]
18+
hwsku = device_info.get_hwsku()
19+
proc = subprocess.Popen(command, universal_newlines=True, stdout=subprocess.PIPE)
20+
proc.communicate()
21+
output = proc.stdout.readlines()
2222
if "Broadcom Limited Device b960" in output or "Broadcom Limited Broadcom BCM56960" in output:
2323
asic = "th"
2424
elif "Broadcom Limited Device b971" in output:
@@ -27,13 +27,13 @@ def get_asic_name():
2727
asic = "td2"
2828
elif "Broadcom Limited Device b870" in output or "Broadcom Inc. and subsidiaries Device b870" in output:
2929
asic = "td3"
30-
else:
30+
31+
if asic == "unknown":
3132
spc1_hwskus = [ 'ACS-MSN2700', 'ACS-MSN2740', 'ACS-MSN2100', 'ACS-MSN2410', 'ACS-MSN2010', 'Mellanox-SN2700', 'Mellanox-SN2700-D48C8' ]
3233
if hwsku.lower() in [spc1_hwsku.lower() for spc1_hwsku in spc1_hwskus]:
3334
asic = "spc1"
34-
35-
return asic
3635

36+
return asic
3737

3838
def rdma_config_update_validator(path, operation):
3939
version_info = device_info.get_sonic_version_info()

0 commit comments

Comments
 (0)