Skip to content

Commit dd75f5b

Browse files
author
Wirut Getbamrung
authored
[device/celestica]: fix lgtm error on sonic_platform (#255)
1 parent a10477d commit dd75f5b

File tree

1 file changed

+4
-7
lines changed
  • device/celestica/x86_64-cel_e1031-r0/sonic_platform

1 file changed

+4
-7
lines changed

device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
#
77
#############################################################################
88

9-
import time
10-
import subprocess
11-
from ctypes import create_string_buffer
12-
139
try:
10+
import time
11+
from ctypes import create_string_buffer
1412
from sonic_platform_base.sfp_base import SfpBase
1513
from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId
1614
from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom
@@ -246,7 +244,7 @@ def __read_eeprom_specific_bytes(self, offset, num_bytes):
246244
raw = sysfsfile_eeprom.read(num_bytes)
247245
for n in range(0, num_bytes):
248246
eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2)
249-
except:
247+
except BaseException:
250248
pass
251249
finally:
252250
if sysfsfile_eeprom:
@@ -914,7 +912,6 @@ def get_tx_disable(self):
914912
A Boolean, True if tx_disable is enabled, False if disabled
915913
"""
916914
tx_disable = False
917-
tx_fault = False
918915
status_control_raw = self.__read_eeprom_specific_bytes(
919916
SFP_CHANNL_STATUS_OFFSET, SFP_CHANNL_STATUS_WIDTH)
920917
if status_control_raw:
@@ -1047,7 +1044,7 @@ def tx_disable(self, tx_disable):
10471044
# Write to eeprom
10481045
sysfsfile_eeprom.seek(SFP_CHANNL_STATUS_OFFSET)
10491046
sysfsfile_eeprom.write(buffer[0])
1050-
except:
1047+
except BaseException:
10511048
#print("Error: unable to open file: %s" % str(e))
10521049
return False
10531050
finally:

0 commit comments

Comments
 (0)