Skip to content

Commit 7ca4f51

Browse files
authored
Update SFP index definition (sonic-net#214)
Signed-off-by: Prince George <[email protected]>
1 parent 0dc71c1 commit 7ca4f51

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

sonic_platform_base/chassis_base.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -468,17 +468,18 @@ def get_all_sfps(self):
468468
A list of objects derived from SfpBase representing all sfps
469469
available on this chassis
470470
"""
471-
return self._sfp_list
471+
return [ sfp for sfp in self._sfp_list if sfp is not None ]
472472

473473
def get_sfp(self, index):
474474
"""
475-
Retrieves sfp represented by (0-based) index <index>
475+
Retrieves sfp corresponding to physical port <index>
476476
477477
Args:
478-
index: An integer, the index (0-based) of the sfp to retrieve.
479-
The index should be the sequence of a physical port in a chassis,
480-
starting from 0.
481-
For example, 0 for Ethernet0, 1 for Ethernet4 and so on.
478+
index: An integer (>=0), the index of the sfp to retrieve.
479+
The index should correspond to the physical port in a chassis.
480+
For example:-
481+
1 for Ethernet0, 2 for Ethernet4 and so on for one platform.
482+
0 for Ethernet0, 1 for Ethernet4 and so on for another platform.
482483
483484
Returns:
484485
An object dervied from SfpBase representing the specified sfp

0 commit comments

Comments
 (0)