Skip to content

Commit c5270c2

Browse files
committed
lgtm updates
1 parent f59307f commit c5270c2

2 files changed

Lines changed: 18 additions & 17 deletions

File tree

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
__all__ = ["platform", "chassis", "sfp", "eeprom", "component", "psu", "thermal", "fan", "fan_drawer"]
2-
from sonic_platform import *

platform/broadcom/sonic-platform-modules-dell/z9332f/sonic_platform/sfp.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@
2323
except ImportError as e:
2424
raise ImportError(str(e) + "- required module not found")
2525

26-
ext_media_module = None
27-
try:
28-
import ext_media_api as ext_media_module
29-
except EnvironmentError:
30-
ext_media_module = None
26+
# Enabled when ext_media is available
27+
#ext_media_module = None
28+
#try:
29+
# import ext_media_api as ext_media_module
30+
#except :
31+
# ext_media_module = None
32+
# pass
3133

3234
PAGE_OFFSET = 0
3335
KEY_OFFSET = 1
@@ -375,13 +377,13 @@ def get_transceiver_info(self):
375377
except (ValueError, TypeError) : pass
376378

377379
# Attempt ext_media read
378-
if ext_media_module is not None:
379-
ext_media_dict = ext_media_module.get_ext_media_info(self)
380-
for key in ext_media_dict:
381-
value = ext_media_dict[key]
382-
if value in [None, 'None', 'none','n/a', '']:
383-
value = 'N/A'
384-
transceiver_info_dict[key] = str(value)
380+
# if ext_media_module is not None:
381+
# ext_media_dict = ext_media_module.get_ext_media_info(self)
382+
# for key in ext_media_dict:
383+
# value = ext_media_dict[key]
384+
# if value in [None, 'None', 'none','n/a', '']:
385+
# value = 'N/A'
386+
# transceiver_info_dict[key] = str(value)
385387

386388
return transceiver_info_dict
387389

@@ -701,24 +703,24 @@ def get_temperature(self):
701703
"""
702704
Retrieves the temperature of this SFP
703705
"""
704-
temperature = None
706+
temperature = 'N/A'
705707
try :
706708
temperature_data = self._get_eeprom_data('Temperature')
707709
temperature = temperature_data['data']['Temperature']['value']
708710
except (TypeError, ValueError):
709-
return None
711+
return 'N/A'
710712
return temperature
711713

712714
def get_voltage(self):
713715
"""
714716
Retrieves the supply voltage of this SFP
715717
"""
716-
voltage = None
718+
voltage = 'N/A'
717719
try:
718720
voltage_data = self._get_eeprom_data('Voltage')
719721
voltage = voltage_data['data']['Vcc']['value']
720722
except (TypeError, ValueError):
721-
return None
723+
return 'N/A'
722724
return voltage
723725

724726
def get_tx_bias(self):

0 commit comments

Comments
 (0)