sonic-platform-common icon indicating copy to clipboard operation
sonic-platform-common copied to clipboard

Add get_transceiver_status and get_transceiver_pm to API interface

Open longhuan-cisco opened this issue 3 years ago • 5 comments

Add get_transceiver_status and get_transceiver_pm to API interface

Description

  1. Add get_transceiver_status to API interface
  2. Add get_transceiver_pm API interface in xcvr_api.py
  3. Ignore if "Rx Signal Power" related fields not existing.
  4. Fix a typo in get_pm_all()

Motivation and Context

How Has This Been Tested?

Plz refer to parent PR for UT.

Additional Information (Optional)

Note This PR serves as dependency for https://github.com/sonic-net/sonic-platform-daemons/pull/304

longhuan-cisco avatar Oct 18 '22 00:10 longhuan-cisco

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: longhuan-cisco (5752d7ee937bde28edfeab3241ac20f52918ed32, 0736d152da8987babd378749779cbfd246557165)

@prgeor please review. This is dependency of https://github.com/sonic-net/sonic-platform-daemons/pull/304

longhuan-cisco avatar Oct 19 '22 23:10 longhuan-cisco

I think you will also need to modify testing script to improve code coverage since it's less than 80% currently.

Added testcase in test_ccmis.py to cover the case of 'Rx Signal Power [dBm]' not present.

longhuan-cisco avatar Oct 27 '22 07:10 longhuan-cisco

@prgeor @mihirpat1 I took care of the existing comments, can you please review?

longhuan-cisco avatar Nov 03 '22 03:11 longhuan-cisco

Added pm table related change, to use this PR to track changes for both status and pm. @prgeor @mihirpat1 Could you please take another look?

longhuan-cisco avatar Nov 08 '22 05:11 longhuan-cisco

This pull request introduces 1 alert when merging 5261da729f50d64eb0a2602dfc6ecda7d124411f into ce9aacb628c5de7632e533deb008c012e0b9c40d - view on LGTM.com

new alerts:

  • 1 for Unnecessary pass

Heads-up: LGTM.com's PR analysis will be disabled on the 5th of December, and LGTM.com will be shut down ⏻ completely on the 16th of December 2022. Please enable GitHub code scanning, which uses the same CodeQL engine :gear: that powers LGTM.com. For more information, please check out our post on the GitHub blog.

lgtm-com[bot] avatar Nov 23 '22 10:11 lgtm-com[bot]

PR https://github.com/sonic-net/sonic-platform-daemons/pull/304 has a dependency on this PR, it has already been included in 202211, this PR shall also be cherry-picked to 202211, otherwise, 202211 will be broken. @prgeor @longhuan-cisco @StormLiangMS

keboliu avatar Jan 17 '23 11:01 keboliu