Skip to content

Provide BMC defaults for system status LED methods in ChassisBase - #731

Open
shreyansh-nexthop wants to merge 2 commits into
sonic-net:masterfrom
nexthop-ai:shreyansh.fix_system_health_cli
Open

Provide BMC defaults for system status LED methods in ChassisBase#731
shreyansh-nexthop wants to merge 2 commits into
sonic-net:masterfrom
nexthop-ai:shreyansh.fix_system_health_cli

Conversation

@shreyansh-nexthop

Copy link
Copy Markdown

Description

Add BMC defaults for the system status LED methods on ChassisBase, gated on is_switch_bmc():

  • initizalize_system_led() returns True
  • set_status_led() returns False
  • get_status_led() returns "N/A"

Non-BMC platforms are unaffected: they still raise NotImplementedError (or use their own platform override). device_info is imported lazily inside each method, matching the existing pattern in module_base.py and bmc_base.py.

Motivation and Context

show system-health (sonic-utilities) calls chassis.initizalize_system_led(), set_status_led() and get_status_led() unconditionally. BMC platforms have no controllable system status LED, and ChassisBase left set/get as NotImplementedError with no initizalize_system_led() at all, so the CLI failed on BMC images. Handling this once in the common base, instead of duplicating no-op stubs in each vendor's chassis.py, keeps the behavior consistent across all BMC platforms.

The method name initizalize_system_led intentionally keeps the existing (misspelled) name used by the show system-health caller and current platform implementations.

How Has This Been Tested?

Non-BMC behavior is unchanged (still NotImplementedError, since is_switch_bmc() is false there). On a BMC image the expected result is that show system-health summary no longer errors and reports System status LED N/A.

Additional Information (Optional)

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks!

---Powered by SONiC BuildBot

@judyjoseph

Copy link
Copy Markdown
Contributor

@shreyansh-nexthop is this ready for review, please set once you complete tests - thx

@shreyansh-nexthop
shreyansh-nexthop force-pushed the shreyansh.fix_system_health_cli branch from 854092b to b94028c Compare August 7, 2026 06:35
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@shreyansh-nexthop
shreyansh-nexthop force-pushed the shreyansh.fix_system_health_cli branch from b94028c to 8ebd14a Compare August 7, 2026 06:41
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

`show system-health` (sonic-utilities) calls initizalize_system_led(),
set_status_led() and get_status_led() unconditionally on the chassis, but
BMC platforms have no controllable system status LED. ChassisBase left
set/get as NotImplementedError and had no initizalize_system_led at all,
so the CLI failed on BMC images.

Provide BMC defaults in ChassisBase, gated on is_switch_bmc():
initizalize_system_led() returns True, set_status_led() returns False, and
get_status_led() returns "N/A". Non-BMC platforms are unaffected: they fall
through to NotImplementedError as before, or override these methods.

Signed-off-by: shreyansh-nexthop <shreyansh@nexthop.ai>
Cover both branches of initizalize_system_led(), set_status_led() and
get_status_led(): the BMC defaults when is_switch_bmc() is true, and the
NotImplementedError path for non-BMC platforms.

Signed-off-by: shreyansh-nexthop <shreyansh@nexthop.ai>
@shreyansh-nexthop
shreyansh-nexthop force-pushed the shreyansh.fix_system_health_cli branch from 8ebd14a to ca02be5 Compare August 7, 2026 06:45
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@shreyansh-nexthop
shreyansh-nexthop marked this pull request as ready for review August 7, 2026 06:46
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@shreyansh-nexthop

Copy link
Copy Markdown
Author

@shreyansh-nexthop is this ready for review, please set once you complete tests - thx

@judyjoseph, the PR is now ready for review. Thanks!

@judyjoseph judyjoseph left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@judyjoseph

Copy link
Copy Markdown
Contributor

@oleksandrivantsiv @vivekrnv for a quick review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants