Skip to content

Commit

Permalink
[Mellanox] Initialize system LED color to green for 201911
Browse files Browse the repository at this point in the history
  • Loading branch information
Junchao-Mellanox committed Jun 10, 2020
1 parent 0a70571 commit 4a85792
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
# Global logger class instance
logger = Logger()

# System LED system fs definitions for 201911 branch only
LED_GREEN = '/run/hw-management/led/led_status_green'
LED_ON = '1'

# magic code defnition for port number, qsfp port position of each hwsku
# port_position_tuple = (PORT_START, QSFP_PORT_START, PORT_END, PORT_IN_BLOCK, EEPROM_OFFSET)
hwsku_dict_port = {'ACS-MSN2010': 3, 'ACS-MSN2100': 1, 'ACS-MSN2410': 2, 'ACS-MSN2700': 0, 'Mellanox-SN2700': 0, 'Mellanox-SN2700-D48C8': 0, 'LS-SN2700':0, 'ACS-MSN2740': 0, 'ACS-MSN3700': 0, 'ACS-MSN3700C': 0, 'ACS-MSN3800': 4, 'Mellanox-SN3800-D112C8': 4, 'ACS-MSN4700': 0, 'ACS-MSN3420': 5, 'ACS-MSN4600C': 4}
Expand All @@ -73,6 +77,7 @@ def __init__(self):
self.sfp_module_initialized = False
self.sfp_event_initialized = False
self.reboot_cause_initialized = False
self.initialize_system_led()
logger.log_info("Chassis loaded successfully")


Expand Down Expand Up @@ -470,3 +475,14 @@ def get_thermal_manager(self):
from .thermal_manager import ThermalManager
return ThermalManager

def initialize_system_led(self):
"""
Init system LED color to green.
This is for 201911 branch only
"""
try:
with open(LED_GREEN, 'w') as f:
f.write(LED_ON)
except:
pass

0 comments on commit 4a85792

Please sign in to comment.