[platform api] Fix sfp index#2937
Conversation
Signed-off-by: Antonina Melnyk <[email protected]>
This is not true. def get_sfp(self, index):
"""
Retrieves sfp represented by (0-based) index <index>
Args:
index: An integer, the index (0-based) of the sfp to retrieve.
The index should be the sequence of a physical port in a chassis,
starting from 0.
For example, 0 for Ethernet0, 1 for Ethernet4 and so on.
Returns:
An object dervied from SfpBase representing the specified sfp
""" |
Ok, I see. But most implementations have this method overridden to accept 1-based index. So returned values in tests are shifted by one. Do we need platform-specific exceptions for this? |
Can you please link to an example of an implementation where the method is overridden to accept 1-based index? |
For example, Arista implementation or Mellanox implementation |
…h other drivers (#163) Update method name to align with other drivers. Change from `parse_qsfp_dom_capability` to `parse_dom_capability`. Other drivers were aligned via sonic-net/sonic-mgmt#2937. When this submodule is updated in sonic-buildimage, all callers will need to be updated to reflect the new nomenclature.
…h other drivers (#163) Update method name to align with other drivers. Change from `parse_qsfp_dom_capability` to `parse_dom_capability`. Other drivers were aligned via sonic-net/sonic-mgmt#2937. When this submodule is updated in sonic-buildimage, all callers will need to be updated to reflect the new nomenclature.
This is due to the fact that these vendors have defined their starting index to be |
yxieca
left a comment
There was a problem hiding this comment.
Should not merge this change.
…atically (sonic-net#16476) src/sonic-utilities * 03292ffe - (HEAD -> 202205, origin/202205) Fix show acl table for masic (sonic-net#2937) (6 minutes ago) [Arvindsrinivasan Lakshmi Narasimhan] * 627a2f59 - [Techsupport] Update the message seen during the lock acquisition failure (sonic-net#2897) (55 minutes ago) [Vivek]
Signed-off-by: Antonina Melnyk [email protected]
Description of PR
Summary:
Fixes # (issue)
Change sfp index from 0-based to 1-based
Type of change
Approach
What is the motivation for this PR?
On practice chassis.get_sfp function accept a 1-based index as its argument. Before the fix, returned values were shifted by one.
How did you do it?
Change sfp index from 0-based to 1-based
How did you verify/test it?
Test is locally
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation