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

[Mellanox] Allow user to set LED to orange #9259

Merged
merged 1 commit into from
Dec 8, 2021

Conversation

Junchao-Mellanox
Copy link
Collaborator

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)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@keboliu
Copy link
Collaborator

keboliu commented Nov 17, 2021

@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
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

@Junchao-Mellanox
Copy link
Collaborator Author

No clean cherry-pick for 202012 and 202106, need separate PRs.

@liat-grozovik
Copy link
Collaborator

@sujinmkang any further comment or we can move forward and merge?

@Junchao-Mellanox Junchao-Mellanox added the Request for 202111 Branch For PRs being requested for 202111 branch label Dec 1, 2021
@sujinmkang sujinmkang merged commit ae09897 into sonic-net:master Dec 8, 2021
@Junchao-Mellanox Junchao-Mellanox deleted the fix-set-led branch December 13, 2021 01:58
Junchao-Mellanox added a commit to Junchao-Mellanox/sonic-buildimage that referenced this pull request Dec 13, 2021
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
Junchao-Mellanox added a commit to Junchao-Mellanox/sonic-buildimage that referenced this pull request Dec 13, 2021
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
qiluo-msft pushed a commit that referenced this pull request Dec 14, 2021
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
liat-grozovik pushed a commit that referenced this pull request Dec 14, 2021
Backport #9259 to 202106

- 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 and unit testing
judyjoseph pushed a commit that referenced this pull request Dec 27, 2021
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants