[DellEMC] Fix Z9100 port index issue (#4309)

This commit is contained in:
Aravind Mani 2020-03-24 09:39:35 +05:30 committed by GitHub
parent 0b52be3e5f
commit 8a6aeace6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,6 +163,28 @@ class Chassis(ChassisBase):
"""
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):
"""
Retrieves the operational status of the chassis