Skip to content

Commit df5f7ac

Browse files
[Edgecore][as4630-54npe] Fixed pytest of sfp reset test item failed.
1 parent d38d290 commit df5f7ac

File tree

1 file changed

+10
-6
lines changed
  • device/accton/x86_64-accton_as4630_54npe-r0/sonic_platform

1 file changed

+10
-6
lines changed

device/accton/x86_64-accton_as4630_54npe-r0/sonic_platform/sfp.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,20 @@ def tx_disable(self, tx_disable):
233233
A boolean, True if tx_disable is set successfully, False if not
234234
"""
235235
if self.port_num < 49: #Copper port, no sysfs
236-
return False
236+
return [False]
237237

238238
if self.port_num < 53:
239+
tx_disable = False
240+
239241
tx_path = "{}{}{}".format(CPLD_I2C_PATH, '/module_tx_disable_', self.port_num)
240-
ret = self._api_helper.write_txt_file(tx_path, 1 if tx_disable else 0)
241-
if ret is not None:
242-
time.sleep(0.01)
243-
return ret
242+
tx_disable = self._api_helper.read_txt_file(tx_path)
243+
if tx_disable is not None:
244+
if tx_disable == '1':
245+
return [True]
246+
else:
247+
return [False]
244248
else:
245-
return False
249+
return [False]
246250

247251
else:
248252
if not self.get_presence():

0 commit comments

Comments
 (0)