[Nokia ixs7215] sfp get_name test case fix (#8507)
Account for sfputil_helper indexing being 0 based Co-authored-by: Carl Keene <keene@nokia.com>
This commit is contained in:
parent
b82abd8dff
commit
32a58e5754
@ -799,6 +799,9 @@ class Sfp(SfpBase):
|
|||||||
Returns:
|
Returns:
|
||||||
A boolean, True if tx_disable is set successfully, False if not
|
A boolean, True if tx_disable is set successfully, False if not
|
||||||
"""
|
"""
|
||||||
|
if self.sfp_type == COPPER_TYPE:
|
||||||
|
return False
|
||||||
|
|
||||||
if smbus_present == 0: # if called from sfputil outside of pmon
|
if smbus_present == 0: # if called from sfputil outside of pmon
|
||||||
cmdstatus, register = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0x5')
|
cmdstatus, register = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0x5')
|
||||||
if cmdstatus:
|
if cmdstatus:
|
||||||
@ -888,7 +891,7 @@ class Sfp(SfpBase):
|
|||||||
sfputil_helper = SfpUtilHelper()
|
sfputil_helper = SfpUtilHelper()
|
||||||
sfputil_helper.read_porttab_mappings(
|
sfputil_helper.read_porttab_mappings(
|
||||||
self.__get_path_to_port_config_file())
|
self.__get_path_to_port_config_file())
|
||||||
name = sfputil_helper.logical[self.index] or "Unknown"
|
name = sfputil_helper.logical[self.index-1] or "Unknown"
|
||||||
return name
|
return name
|
||||||
|
|
||||||
def get_presence(self):
|
def get_presence(self):
|
||||||
|
Reference in New Issue
Block a user