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

Added PSU CLI #152

Merged
merged 3 commits into from
Nov 28, 2017
Merged

Added PSU CLI #152

merged 3 commits into from
Nov 28, 2017

Conversation

andrii-savka
Copy link

No description provided.

psuutil/main.py Outdated

SYSLOG_IDENTIFIER = "psuutil"
PLATFORM_SPECIFIC_MODULE_NAME = "psuutil"
PLATFORM_SPECIFIC_CLASS_NAME = "PSUutil"
Copy link
Contributor

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

Copy link
Author

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"
Copy link
Contributor

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"

Copy link
Author

Choose a reason for hiding this comment

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

Done

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

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.

Copy link
Author

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

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

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.

Copy link
Author

Choose a reason for hiding this comment

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

Added more details

@jleveque jleveque merged commit fb48cdf into sonic-net:master Nov 28, 2017
vdahiya12 pushed a commit to vdahiya12/sonic-utilities that referenced this pull request Jul 23, 2021
sonic-net/sonic-buildimage#6768 change the kvm artifact name from kvm to vs

Signed-off-by: Guohan Lu <lguohan@gmail.com>
mihirpat1 pushed a commit to mihirpat1/sonic-utilities that referenced this pull request Sep 15, 2023
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
```
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