Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion sonic_platform_base/module_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ class ModuleBase(device_base.DeviceBase):
# Module state is Present when it is powered up, but entered a fault state.
# Module is not able to go Online.
MODULE_STATUS_FAULT = "Fault"
# Module state when module is detected, is able to run SONiC, but is not yet running SONiC.
# Modules in this state will be attempted to be converted to SONiC via calls to module.provision_module()
# This state does not make much sense if provision_module() is not implemented.
MODULE_STATUS_PROVISION_READY = "ProvisionReady"
# Module state if module is currently undergoing provisioning.
# Module is not expected to be contactable in this state.
MODULE_STATUS_PROVISION_PENDING = "ProvisionPending"
# Module state once module has been provisioned successfully,
# but the chassis requires a reboot to fully incorporate the module.
MODULE_STATUS_PROVISIONED = "Provisioned"
# Module state is Online when fully operational
MODULE_STATUS_ONLINE = "Online"

Expand Down Expand Up @@ -221,7 +231,9 @@ def get_oper_status(self):
Returns:
A string, the operational status of the module from one of the
predefined status values: MODULE_STATUS_EMPTY, MODULE_STATUS_OFFLINE,
MODULE_STATUS_FAULT, MODULE_STATUS_PRESENT or MODULE_STATUS_ONLINE
MODULE_STATUS_FAULT, MODULE_STATUS_PRESENT, MODULE_STATUS_PROVISION_READY,
MODULE_STATUS_PROVISION_PENDING, MODULE_STATUS_PROVISIONED,
or MODULE_STATUS_ONLINE
"""
raise NotImplementedError

Expand Down Expand Up @@ -270,6 +282,17 @@ def get_maximum_consumed_power(self):
"""
raise NotImplementedError

def provision_module(self):
"""
Request to provision the module.
This method should be implemented if the module supports
MODULE_STATUS_PROVISION_READY state.

Returns:
bool: True if the request has been issued successfully, False if not
"""
raise NotImplementedError

##############################################
# SmartSwitch methods
##############################################
Expand Down
Loading