diff --git a/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/led_control.py b/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/led_control.py index e3b1c484acd..935343a84ce 100644 --- a/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/led_control.py +++ b/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/led_control.py @@ -37,9 +37,8 @@ def __init__(self): self._initDefaultConfig() def _initDefaultConfig(self): - # For the D1 box the port leds are controlled by Trident3 LED program - # The fan tray leds will be managed with the new thermalctl daemon / chassis class based API - # leaving only the system leds to be done old style + # The fan tray leds and system led managed by new chassis class API + # leaving only a couple other front panel leds to be done old style DBG_PRINT("starting system leds") self._initSystemLed() DBG_PRINT(" led done") @@ -77,31 +76,39 @@ def _initSystemLed(self): while True: # Front Panel FAN Panel LED setting in register 0x08 if (self.chassis.get_fan(0).get_status() == self.chassis.get_fan(1).get_status() == True): - if oldfan != 0x1: - if (os.path.isfile("/sys/class/gpio/fanLedAmber/value")): + if (os.path.isfile("/sys/class/gpio/fanLedAmber/value")): + if oldfan != 0x1: self._set_i2c_register("/sys/class/gpio/fanLedAmber/value", 0) self._set_i2c_register("/sys/class/gpio/fanLedGreen/value", 1) oldfan = 0x1 + else: + oldfan = 0xf else: - if oldfan != 0x0: - if (os.path.isfile("/sys/class/gpio/fanLedGreen/value")): + if (os.path.isfile("/sys/class/gpio/fanLedGreen/value")): + if oldfan != 0x0: self._set_i2c_register("/sys/class/gpio/fanLedGreen/value", 0) self._set_i2c_register("/sys/class/gpio/fanLedAmber/value", 1) oldfan = 0x0 + else: + oldfan = 0xf # Front Panel PSU Panel LED setting in register 0x09 if (self.chassis.get_psu(0).get_status() == self.chassis.get_psu(1).get_status() == True): - if oldpsu != 0x1: - if (os.path.isfile("/sys/class/gpio/psuLedAmber/value")): + if (os.path.isfile("/sys/class/gpio/psuLedAmber/value")): + if oldpsu != 0x1: self._set_i2c_register("/sys/class/gpio/psuLedAmber/value", 0) self._set_i2c_register("/sys/class/gpio/psuLedGreen/value", 1) oldpsu = 0x1 + else: + oldpsu = 0xf else: - if oldpsu != 0x0: - if (os.path.isfile("/sys/class/gpio/psuLedGreen/value")): + if (os.path.isfile("/sys/class/gpio/psuLedGreen/value")): + if oldpsu != 0x0: self._set_i2c_register("/sys/class/gpio/psuLedGreen/value", 0) self._set_i2c_register("/sys/class/gpio/psuLedAmber/value", 1) oldpsu = 0x0 + else: + oldpsu = 0xf time.sleep(6) # Helper method to map SONiC port name to index diff --git a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py index 51ad34ae8f4..1bf3d4c03db 100644 --- a/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py +++ b/platform/marvell-armhf/sonic-platform-nokia/7215/sonic_platform/sfp.py @@ -166,8 +166,6 @@ def __init__(self, index, sfp_type, eeprom_path, port_i2c_map): self.dom_tx_power_supported = False self.calibration = 0 - self._dom_capability_detect() - def __convert_string_to_num(self, value_str): if "-inf" in value_str: return 'N/A' @@ -402,6 +400,7 @@ def get_transceiver_bulk_status(self): if self.sfp_type == SFP_TYPE: + self._dom_capability_detect() if not self.dom_supported: return transceiver_dom_info_dict @@ -487,6 +486,7 @@ def get_transceiver_threshold_info(self): offset = SFP_MODULE_ADDRA2_OFFSET + self._dom_capability_detect() if not self.dom_supported: return transceiver_dom_threshold_info_dict @@ -533,6 +533,7 @@ def get_reset_status(self): Returns: A Boolean, True if reset enabled, False if disabled """ + self._dom_capability_detect() if not self.dom_supported: return False if self.sfp_type == COPPER_TYPE: @@ -710,6 +711,7 @@ def get_rx_power(self): if sfpd_obj is None: return None + self._dom_capability_detect() if self.dom_supported: sfpd_obj._calibration_type = self.calibration @@ -747,6 +749,7 @@ def get_tx_power(self): if sfpd_obj is None: return None + self._dom_capability_detect() if self.dom_supported: sfpd_obj._calibration_type = self.calibration