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

Fixing #12634 #12636

Merged
merged 2 commits into from
Dec 17, 2022
Merged

Fixing #12634 #12636

merged 2 commits into from
Dec 17, 2022

Conversation

FuzailBrcm
Copy link
Contributor

Why I did it

Fixes #12634

Observing the following error while running 'sfputil show lpmode' command.
AttributeError: 'Sfp' object has no attribute 'get_power_set'

Root Cause: get_power_set() is defined for QSFP28 and QSFP+ i.e. Sff8636 and Sff8634. However, the function is not defined in the optoe_base class.

How I did it

To use get_power_set(), we need to initialise the 'api' via get_xcvr_api() and then use it to run get_power_set().

How to verify it

sfputil show lpmode

 

root@sonic:/home/admin# sfputil show lpmode

Port         Low-power Mode

-----------  ----------------

Ethernet88   Off

Ethernet96   Off

Ethernet248  Off

Ethernet240  Off

Ethernet32   Off

 

root@sonic:/home/admin# sfputil lpmode on Ethernet240

Enabling low-power mode for port Ethernet240 ... OK

root@sonic:/home/admin#

root@sonic:/home/admin# sfputil show lpmode

Port         Low-power Mode

-----------  ----------------

Ethernet240  On

Ethernet80   Off

..........

 

root@sonic:~# sfputil lpmode off Ethernet240

Disabling low-power mode for port Ethernet240 ... OK

root@sonic:~#

root@sonic:~#

root@sonic:~#

root@sonic:~# sfputil show lpmode

Port         Low-power Mode

-----------  ----------------

...............

Ethernet248  Off

........

Ethernet240  Off

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

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

@FuzailBrcm FuzailBrcm requested a review from lguohan as a code owner November 8, 2022 09:25
@FuzailBrcm
Copy link
Contributor Author

@prgeor , @ds952811
Please review

Copy link
Contributor

@jostar-yang jostar-yang left a comment

Choose a reason for hiding this comment

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

it is fine to me.

@FuzailBrcm
Copy link
Contributor Author

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 12636 in repo sonic-net/sonic-buildimage

@FuzailBrcm
Copy link
Contributor Author

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@adyeung
Copy link
Collaborator

adyeung commented Nov 23, 2022

@prgeor @lguohan pls help review and merge

@lguohan lguohan merged commit 8788f1c into sonic-net:master Dec 17, 2022
qnos pushed a commit to qnos/sonic-buildimage that referenced this pull request Nov 12, 2023
… lpmode' command. (sonic-net#12636)

Why I did it
Fixes sonic-net#12634

Observing the following error while running 'sfputil show lpmode' command.
AttributeError: 'Sfp' object has no attribute 'get_power_set'

Root Cause: get_power_set() is defined for QSFP28 and QSFP+ i.e. Sff8636 and Sff8634. However, the function is not defined in the optoe_base class.

How I did it
To use get_power_set(), we need to initialise the 'api' via get_xcvr_api() and then use it to run get_power_set().
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.

[PDDF] sfputil show lpmode will get error message
6 participants