Skip to content
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

Update for the procedures for insertion/hot swap of Switch Fabric Module(SFM) by using "config chassis modules shutdown/startup" commands #6

Merged
merged 10 commits into from
May 9, 2024
Merged
18 changes: 16 additions & 2 deletions chassis/sonic_platform/module.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
EEPROM_SERIAL = '0x23'
EEPROM_BASE_MAC = '0x24'

MODULE_ADMIN_DOWN = 0

class Module(ModuleBase):
"""Nokia IXR-7250 Platform-specific Module class"""

Expand Down Expand Up @@ -208,7 +210,7 @@ def _get_hw_slot(self):
int: slot representation, usually number
"""
return self.hw_slot

def get_slot(self):
"""
Retrieves the slot where the module is present
Expand Down Expand Up @@ -307,7 +309,19 @@ def set_admin_state(self, up):
Returns:
bool: True if the request has been successful, False if not
"""
return False
if self.get_type() == self.MODULE_TYPE_FABRIC:
if up == MODULE_ADMIN_DOWN:
logger.log_info("Power off {} module ...".format(self.module_name))
mlok-nokia marked this conversation as resolved.
Show resolved Hide resolved
nokia_common._power_onoff_SFM(self.hw_slot,False)
logger.log_info("Chassis module {} shutdown completed".format(self.module_name))
mlok-nokia marked this conversation as resolved.
Show resolved Hide resolved
else:
logger.log_info("Starting up chassis module {}".format(self.module_name))
mlok-nokia marked this conversation as resolved.
Show resolved Hide resolved
logger.log_info("Power on {} module ...".format(self.module_name))
mlok-nokia marked this conversation as resolved.
Show resolved Hide resolved
nokia_common._power_onoff_SFM(self.hw_slot,True)

return True
else:
return False

def get_platform_type(self):
"""
Expand Down