-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Mellanox] Allow user to set LED to orange #9259
Conversation
@sujinmkang @prgeor would you please help to review this PR? It's a bug fix to Nvidia platform API implementation. |
@@ -62,7 +62,9 @@ def mock_write_file(file_path, content, **kwargs): | |||
assert obj.set_status_led(Led.STATUS_LED_COLOR_GREEN) is True | |||
assert obj.get_status_led() == Led.STATUS_LED_COLOR_GREEN | |||
mock_file_content[physical_led.get_green_led_path()] = Led.LED_OFF | |||
assert obj.set_status_led(Led.STATUS_LED_COLOR_ORANGE) is False | |||
assert obj.set_status_led(Led.STATUS_LED_COLOR_ORANGE) is True | |||
assert obj.get_status_led() == Led.STATUS_LED_COLOR_RED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not Led.STATUS_LED_COLOR_ORANGE but Led.STATUS_LED_COLOR_RED?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might display led color in CLI by calling get_status_led, and we want user to understand green=OK, red=Not OK. Different platform might support different LED color, this is to unify the behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Junchao-Mellanox Got it. I found the get_status() returns STATUS_LED_COLOR_RED for both RED and ORANGE LED.
No clean cherry-pick for 202012 and 202106, need separate PRs. |
@sujinmkang any further comment or we can move forward and merge? |
Why I did it Nvidia platform API does not support set LED to orange How I did it Allow user to set LED to orange How to verify it Added unit test Manual test Conflicts: platform/mellanox/mlnx-platform-api/sonic_platform/led.py platform/mellanox/mlnx-platform-api/tests/test_led.py
Why I did it Nvidia platform API does not support set LED to orange How I did it Allow user to set LED to orange How to verify it Added unit test Manual test
Backport #9259 to 202012 #### Why I did it Nvidia platform API does not support set LED to orange. #### How I did it Allow user to set LED to orange #### How to verify it Manual test
Why I did it Nvidia platform API does not support set LED to orange How I did it Allow user to set LED to orange How to verify it Added unit test Manual test
Why I did it
Nvidia platform API does not support set LED to orange
How I did it
Allow user to set LED to orange
How to verify it
Added unit test
Manual test
Which release branch to backport (provide reason below if selected)
Description for the changelog
A picture of a cute animal (not mandatory but encouraged)