Skip to content

Commit

Permalink
Update SFP index definition (#214)
Browse files Browse the repository at this point in the history
Signed-off-by: Prince George <prgeor@microsoft.com>
  • Loading branch information
prgeor authored Aug 26, 2021
1 parent 0dc71c1 commit 7ca4f51
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sonic_platform_base/chassis_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,17 +468,18 @@ def get_all_sfps(self):
A list of objects derived from SfpBase representing all sfps
available on this chassis
"""
return self._sfp_list
return [ sfp for sfp in self._sfp_list if sfp is not None ]

def get_sfp(self, index):
"""
Retrieves sfp represented by (0-based) index <index>
Retrieves sfp corresponding to physical port <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.
index: An integer (>=0), the index of the sfp to retrieve.
The index should correspond to the physical port in a chassis.
For example:-
1 for Ethernet0, 2 for Ethernet4 and so on for one platform.
0 for Ethernet0, 1 for Ethernet4 and so on for another platform.
Returns:
An object dervied from SfpBase representing the specified sfp
Expand Down

0 comments on commit 7ca4f51

Please sign in to comment.