Skip to content

Commit

Permalink
[DellEMC] Fix Z9100 port index issue (#4309)
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindmani-1 committed Mar 24, 2020
1 parent 0b52be3 commit 8a6aeac
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,28 @@ def get_serial(self):
string: Serial number of chassis
"""
return self._eeprom.serial_str()

def get_sfp(self, index):
"""
Retrieves sfp represented by (1-based) index <index>
Args:
index: An integer, the index (1-based) of the sfp to retrieve.
The index should be the sequence of a physical port in a chassis,
starting from 1.
For example, 0 for Ethernet0, 1 for Ethernet4 and so on.
Returns:
An object dervied from SfpBase representing the specified sfp
"""
sfp = None

try:
sfp = self._sfp_list[index-1]
except IndexError:
sys.stderr.write("SFP index {} out of range (1-{})\n".format(
index, len(self._sfp_list)-1))
return sfp

def get_status(self):
"""
Expand Down

0 comments on commit 8a6aeac

Please sign in to comment.