-
Notifications
You must be signed in to change notification settings - Fork 664
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
Added PSU CLI #152
Added PSU CLI #152
Conversation
psuutil/main.py
Outdated
|
||
SYSLOG_IDENTIFIER = "psuutil" | ||
PLATFORM_SPECIFIC_MODULE_NAME = "psuutil" | ||
PLATFORM_SPECIFIC_CLASS_NAME = "PSUutil" |
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.
Suggest changing case of class name to PsuUtil
to match CamelCase of SfpUtil
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.
Changed to "PsuUtil"
psuutil/main.py
Outdated
# 'numpsus' subcommand | ||
@cli.command() | ||
def numpsus(): | ||
"number of supported PSU in the device" |
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.
Suggest "Display number of supported PSU in the device"
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.
Done
sonic_psu/psu_base.py
Outdated
@@ -26,10 +26,22 @@ def get_num_psus(self): | |||
@abc.abstractmethod | |||
def get_psu_status(self, index): | |||
""" | |||
Retrieves the oprational status of power supply unit (PSU) defined | |||
Retrieves the operational status of power supply unit (PSU) defined | |||
by index <index> | |||
|
|||
:param index: An integer, index of the PSU of which to query status | |||
:return: Boolean, True if PSU is operating properly, False if PSU is faulty |
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.
Could you also please add more detail to my description here to reflect what we have discussed as "faulty" (e.g., if the PSU is present but powered off, it is considered a fault, and should return false.
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.
More details has been added
sonic_psu/psu_base.py
Outdated
@@ -26,10 +26,22 @@ def get_num_psus(self): | |||
@abc.abstractmethod | |||
def get_psu_status(self, index): | |||
""" | |||
Retrieves the oprational status of power supply unit (PSU) defined | |||
Retrieves the operational status of power supply unit (PSU) defined | |||
by index <index> | |||
|
|||
:param index: An integer, index of the PSU of which to query status |
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.
Is it zero-based index? I think this info should be here.
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.
Added more details
sonic-net/sonic-buildimage#6768 change the kvm artifact name from kvm to vs Signed-off-by: Guohan Lu <[email protected]>
Fix errors like below: ``` admin@sonic:~$ show version SONiC Software Version: SONiC.master.0-dirty-20201204.005739 Distribution: Debian 10.6 Kernel: 4.19.0-9-2-amd64 Build commit: 873fb969 Build date: Fri Dec 4 09:02:43 UTC 2020 Built by: user@sonic-build Platform: x86_64-accton_wedge100bf_32x-r0 HwSKU: montara ASIC: barefoot Traceback (most recent call last): File "/usr/local/bin/decode-syseeprom", line 171, in <module> exit(main()) File "/usr/local/bin/decode-syseeprom", line 47, in main t = class_('board', '','','') File "/usr/share/sonic/device/x86_64-accton_wedge100bf_32x-r0/plugins/eeprom.py", line 113, in __init__ if self.eeprom_init(): File "/usr/share/sonic/device/x86_64-accton_wedge100bf_32x-r0/plugins/eeprom.py", line 180, in eeprom_init self, "", [eeprom_params]) File "/usr/local/lib/python3.7/dist-packages/sonic_eeprom/eeprom_tlvinfo.py", line 178, in set_eeprom new_tlvs += new_tlv TypeError: can't concat str to bytearray ```
No description provided.