Skip to content

Commit

Permalink
[sonic-platform-common] Fix name error and import error (sonic-net#143)
Browse files Browse the repository at this point in the history
1. Fix name error in psu_base.py
2. change absolute import to relative import for sff8024
  • Loading branch information
Junchao-Mellanox authored Nov 17, 2020
1 parent e4883e5 commit 5db8c84
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 3 additions & 1 deletion sonic_platform_base/psu_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PsuBase(device_base.DeviceBase):
_thermal_list = []

# Status of Master LED
psu_master_led_color = STATUS_LED_COLOR_OFF
psu_master_led_color = None

def __init__(self):
self._fan_list = []
Expand All @@ -36,6 +36,8 @@ def __init__(self):
# available on the PSU
self._thermal_list = []

self.psu_master_led_color = self.STATUS_LED_COLOR_OFF

def get_num_fans(self):
"""
Retrieves the number of fan modules available on this PSU
Expand Down
22 changes: 11 additions & 11 deletions sonic_platform_base/sonic_sfp/qsfp_dd.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
from __future__ import print_function

try:
from sff8024 import type_of_transceiver # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sff8024 import type_abbrv_name # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sff8024 import connector_dict # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sff8024 import ext_type_of_transceiver # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sff8024 import type_of_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sff8024 import host_electrical_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sff8024 import nm_850_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sff8024 import sm_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sff8024 import passive_copper_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sff8024 import active_cable_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sff8024 import base_t_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import type_of_transceiver # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import type_abbrv_name # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import connector_dict # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import ext_type_of_transceiver # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import type_of_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import host_electrical_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import nm_850_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import sm_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import passive_copper_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import active_cable_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from .sff8024 import base_t_media_interface # Dot module supports both Python 2 and Python 3 using explicit relative import methods
from sonic_platform_base.sonic_sfp.sffbase import sffbase # Dot module supports both Python 2 and Python 3 using explicit relative import methods
except ImportError as e:
raise ImportError (str(e) + "- required module not found")
Expand Down

0 comments on commit 5db8c84

Please sign in to comment.