-
Notifications
You must be signed in to change notification settings - Fork 732
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
[platform api] Fix sfp index #2937
Conversation
Signed-off-by: Antonina Melnyk <antoninax.melnyk@intel.com>
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 |
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.
Should not merge this change.
Signed-off-by: Antonina Melnyk antoninax.melnyk@intel.com
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