Skip to content

[device/celestica]: fix lgtm error on sonic_platform #255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions device/celestica/x86_64-cel_e1031-r0/sonic_platform/sfp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
#
#############################################################################

import time
import subprocess
from ctypes import create_string_buffer

try:
import time
from ctypes import create_string_buffer
from sonic_platform_base.sfp_base import SfpBase
from sonic_platform_base.sonic_sfp.sff8472 import sff8472InterfaceId
from sonic_platform_base.sonic_sfp.sff8472 import sff8472Dom
Expand Down Expand Up @@ -246,7 +244,7 @@ def __read_eeprom_specific_bytes(self, offset, num_bytes):
raw = sysfsfile_eeprom.read(num_bytes)
for n in range(0, num_bytes):
eeprom_raw[n] = hex(ord(raw[n]))[2:].zfill(2)
except:
except BaseException:
pass
finally:
if sysfsfile_eeprom:
Expand Down Expand Up @@ -914,7 +912,6 @@ def get_tx_disable(self):
A Boolean, True if tx_disable is enabled, False if disabled
"""
tx_disable = False
tx_fault = False
status_control_raw = self.__read_eeprom_specific_bytes(
SFP_CHANNL_STATUS_OFFSET, SFP_CHANNL_STATUS_WIDTH)
if status_control_raw:
Expand Down Expand Up @@ -1047,7 +1044,7 @@ def tx_disable(self, tx_disable):
# Write to eeprom
sysfsfile_eeprom.seek(SFP_CHANNL_STATUS_OFFSET)
sysfsfile_eeprom.write(buffer[0])
except:
except BaseException:
#print("Error: unable to open file: %s" % str(e))
return False
finally:
Expand Down