@@ -158,7 +158,7 @@ def get_low_power_mode(self, port_num):
158
158
lpm_cmd = ["docker" , "exec" , "syncd" , "python" , "/usr/share/sonic/platform/plugins/sfplpmget.py" , str (port_num )]
159
159
160
160
try :
161
- output = subprocess .run (lpm_cmd , universal_newlines = True , capture_output = True , check = True ). stdout
161
+ output = subprocess .check_output (lpm_cmd , universal_newlines = True )
162
162
if 'LPM ON' in output :
163
163
return True
164
164
except subprocess .CalledProcessError as e :
@@ -182,7 +182,7 @@ def set_low_power_mode(self, port_num, lpmode):
182
182
183
183
# Set LPM
184
184
try :
185
- subprocess .run (lpm_cmd , check = True , universal_newlines = True , capture_output = True ). stdout
185
+ subprocess .check_output (lpm_cmd , universal_newlines = True )
186
186
except subprocess .CalledProcessError as e :
187
187
print ("Error! Unable to set LPM for {}, rc = {}, err msg: {}" .format (port_num , e .returncode , e .output ))
188
188
return False
@@ -197,7 +197,7 @@ def reset(self, port_num):
197
197
lpm_cmd = ["docker" , "exec" , "syncd" , "python" , "/usr/share/sonic/platform/plugins/sfpreset.py" , str (port_num )]
198
198
199
199
try :
200
- subprocess .run (lpm_cmd , check = True , universal_newlines = True , capture_output = True ). stdout
200
+ subprocess .check_output (lpm_cmd , universal_newlines = True )
201
201
return True
202
202
except subprocess .CalledProcessError as e :
203
203
print ("Error! Unable to set LPM for {}, rc = {}, err msg: {}" .format (port_num , e .returncode , e .output ))
@@ -269,7 +269,7 @@ def _read_eeprom_specific_bytes_via_ethtool(self, port_num, offset, num_bytes):
269
269
eeprom_raw = []
270
270
ethtool_cmd = ["ethtool" , "-m" , sfpname , "hex" , "on" , "offset" , str (offset ), "length" , str (num_bytes )]
271
271
try :
272
- output = subprocess .run (ethtool_cmd , check = True , universal_newlines = True , capture_output = True ). stdout
272
+ output = subprocess .check_output (ethtool_cmd , universal_newlines = True )
273
273
output_lines = output .splitlines ()
274
274
first_line_raw = output_lines [0 ]
275
275
if "Offset" in first_line_raw :
0 commit comments