File tree 1 file changed +8
-6
lines changed
platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ def get_cpld2_version():
50
50
def get_ssd_version ():
51
51
val = 'NA'
52
52
try :
53
- ssd_ver = subprocess .check_output (['ssdutil' ,'-v' ], text = True )
54
- except Exception :
55
- return val
53
+ ssd_ver = subprocess .check_output (['ssdutil' , '-v' ],
54
+ stderr = subprocess .STDOUT , text = True )
55
+ except (FileNotFoundError , subprocess .CalledProcessError ):
56
+ pass
56
57
else :
57
58
version = re .search (r'Firmware\s*:(.*)' ,ssd_ver )
58
59
if version :
@@ -63,9 +64,10 @@ def get_ssd_version():
63
64
def get_pciephy_version ():
64
65
val = 'NA'
65
66
try :
66
- pcie_ver = subprocess .check_output ('bcmcmd "pciephy fw version"' , shell = True , text = True )
67
- except Exception :
68
- return val
67
+ pcie_ver = subprocess .check_output (['bcmcmd' , 'pciephy fw version' ],
68
+ stderr = subprocess .STDOUT , text = True )
69
+ except (FileNotFoundError , subprocess .CalledProcessError ):
70
+ pass
69
71
else :
70
72
version = re .search (r'PCIe FW loader version:\s(.*)' , pcie_ver )
71
73
if version :
You can’t perform that action at this time.
0 commit comments