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

[psu_base] get_status_led() returns current state of the status LED #39

Merged
merged 2 commits into from
Jul 15, 2019
Merged

[psu_base] get_status_led() returns current state of the status LED #39

merged 2 commits into from
Jul 15, 2019

Conversation

jleveque
Copy link
Contributor

@jleveque jleveque commented Jul 5, 2019

  • Also add the same function to fan_base.py.

@jleveque jleveque self-assigned this Jul 5, 2019
@jleveque jleveque requested a review from lguohan July 5, 2019 22:34
Copy link

@kannankvs kannankvs left a comment

Choose a reason for hiding this comment

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

get_status_led in fan.py - Comment says "PSU"; pls change to FAN.

Copy link

@kannankvs kannankvs left a comment

Choose a reason for hiding this comment

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

In psu.py, please add AMBER in the color list.
Also, is it better to rename those variables " STATUS_LED_COLOR_GREEN" as "PSU_STATUS_LED_COLOR_GREEN". This way,we can keep separate variables for FAN LEDs and separate variables for front panel LEDs. For example, in case of front panel LEDs, blue color is also valid, which is invalid in case of power LEDs.

Copy link

@kannankvs kannankvs left a comment

Choose a reason for hiding this comment

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

psu.py: In addition to returning color, shall we return the "flashing" status also? We think that most of the vendors support "flashing" status also which can hold "Solid" or "Blinking" values. If yes, lets change the return value as tuple instead of simple string.

@jleveque
Copy link
Contributor Author

jleveque commented Jul 9, 2019

In psu.py, please add AMBER in the color list.

Added STATUS_LED_COLOR_AMBER to both psu_base and fan_base.

Also, is it better to rename those variables " STATUS_LED_COLOR_GREEN" as "PSU_STATUS_LED_COLOR_GREEN". This way,we can keep separate variables for FAN LEDs and separate variables for front panel LEDs. For example, in case of front panel LEDs, blue color is also valid, which is invalid in case of power LEDs.

I feel this is unnecessary since these are class members. They need to be accessed by referencing the class (e.g., this.STATUS_LED_COLOR_GREEN, my_fan.STATUS_LED_COLOR_GREEN, etc.). I feel it is better to cover all bases, so each list should contain all possibilities. We may also want to just make one list and share it among all device classes which can control LEDs.

psu.py: In addition to returning color, shall we return the "flashing" status also? We think that most of the vendors support "flashing" status also which can hold "Solid" or "Blinking" values. If yes, lets change the return value as tuple instead of simple string.

We could go the tuple route, or we could simply add new "colors," e.g., STATUS_LED_COLOR_GREEN_SOLID, STATUS_LED_COLOR_GREEN_FLASHING. If we decide it's better to go the tuple route, I would ask if it makes sense to add a flashing rate parameter to specify the frequency with which it should flash?

@kannankvs
Copy link

'''Joe:I would ask if it makes sense to add a flashing rate parameter to specify the frequency with which it should flash?'''
Flashing rate may not be important for the caller.

@jleveque
Copy link
Contributor Author

@kannankvs: Do you have an opinion on the tuple vs. new "colors" approach I proposed above?

@kannankvs
Copy link

Joe: @kannankvs: Do you have an opinion on the tuple vs. new "colors" approach I proposed above?
Tuple is better. Even there is a need to add one or two new colors to the colors_list or if there is a need to add one other flashing status in future, it will be easier if we use "tuple". In general, we always prefer two different information in two different variables instead of combining them in a single variable.

@jleveque
Copy link
Contributor Author

@kannankvs: Understood. Then I must ask, do you think it's better to denote "off" as a "color" as it is now, or as a state (e.g., STATUS_LED_STATE_OFF, STATUS_LED_STATE_ON_SOLID, STATUS_LED_STATE_ON_FLASHING)?

@kannankvs
Copy link

@jleveque OFF is a state like "Solid", "Blinking". I missed to see that OFF in the list.

@jleveque
Copy link
Contributor Author

@kannankvs: I think the change to a tuple that you've requested should be dealt with in a separate PR. Would you be willing to make that change? If so, let's get this PR approved and merged first.

@kannankvs
Copy link

@jleveque : OK, we will do it. Once if this PR is merged, we will raise PR for the tuple.

@jleveque
Copy link
Contributor Author

@kannankvs: Sounds good. Pleas approve this PR if you are OK with it.

@kannankvs
Copy link

@jleveque : Approvals done. Thank you.

@jleveque jleveque merged commit e5ed2ab into sonic-net:master Jul 15, 2019
@jleveque jleveque deleted the fix_get_status_led branch July 15, 2019 17:52
jleveque pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Aug 14, 2019
[sonic-platform-common]

[sonic_sfp] Interpret sff 'int' element =0 as valid value (sonic-net/sonic-platform-common#51)
add more error code to get_transceiver_change_event ((sonic-net/sonic-platform-common#50)
[sonic_platform_base] support new-platform-api-based daemons ((sonic-net/sonic-platform-common#48)
sync change to sonic_platform_base/sonic_sfp and create symbol link ((sonic-net/sonic-platform-common#49)
Add parser support for Tx_RxLos,TxFault, PowerControl, ResetStatus in sff8436.py ((sonic-net/sonic-platform-common#45)
readd type_abbrv_name in sonic_sfp/sff8436.py ((sonic-net/sonic-platform-common#44)
[psu_base] get_status_led() returns current state of the status LED ((sonic-net/sonic-platform-common#39)
Fix abbrv name for OSFP ((sonic-net/sonic-platform-common#36)
[sff8436] support "Control Bytes" and "Options" ((sonic-net/sonic-platform-common#38)
sonic_sfp: avoid possible key error in get_physical_to_logical() ((sonic-net/sonic-platform-common#37)

[sonic-platform-daemons]

[xcvrd] Enhance xcvrd to handle new system level event/error (sonic-net/sonic-platform-daemons#39)
[xcvrd] Support both new platform API and old platform plugins (sonic-net/sonic-platform-daemons#38)
[psud] Support both new platform API and old platform plugins (sonic-net/sonic-platform-daemons#37)
[syseepromd] Support both new platform API and old platform plugins (sonic-net/sonic-platform-daemons#36)
Add missing import statemet (sonic-net/sonic-platform-daemons#32)
sonic_xcvrd: Support for DOM Threshold values for EEPROM dump (sonic-net/sonic-platform-daemons#29)
@jleveque jleveque added the PSU label Jul 11, 2020
wangshengjun pushed a commit to wangshengjun/sonic-buildimage that referenced this pull request Nov 16, 2020
…ic-net#3333)

[sonic-platform-common]

[sonic_sfp] Interpret sff 'int' element =0 as valid value (sonic-net/sonic-platform-common#51)
add more error code to get_transceiver_change_event ((sonic-net/sonic-platform-common#50)
[sonic_platform_base] support new-platform-api-based daemons ((sonic-net/sonic-platform-common#48)
sync change to sonic_platform_base/sonic_sfp and create symbol link ((sonic-net/sonic-platform-common#49)
Add parser support for Tx_RxLos,TxFault, PowerControl, ResetStatus in sff8436.py ((sonic-net/sonic-platform-common#45)
readd type_abbrv_name in sonic_sfp/sff8436.py ((sonic-net/sonic-platform-common#44)
[psu_base] get_status_led() returns current state of the status LED ((sonic-net/sonic-platform-common#39)
Fix abbrv name for OSFP ((sonic-net/sonic-platform-common#36)
[sff8436] support "Control Bytes" and "Options" ((sonic-net/sonic-platform-common#38)
sonic_sfp: avoid possible key error in get_physical_to_logical() ((sonic-net/sonic-platform-common#37)

[sonic-platform-daemons]

[xcvrd] Enhance xcvrd to handle new system level event/error (sonic-net/sonic-platform-daemons#39)
[xcvrd] Support both new platform API and old platform plugins (sonic-net/sonic-platform-daemons#38)
[psud] Support both new platform API and old platform plugins (sonic-net/sonic-platform-daemons#37)
[syseepromd] Support both new platform API and old platform plugins (sonic-net/sonic-platform-daemons#36)
Add missing import statemet (sonic-net/sonic-platform-daemons#32)
sonic_xcvrd: Support for DOM Threshold values for EEPROM dump (sonic-net/sonic-platform-daemons#29)
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.

2 participants