Skip to content

Commit

Permalink
[Nokia ixs7215] sfp get_name test case fix (#8507)
Browse files Browse the repository at this point in the history
Account for sfputil_helper indexing being 0 based

Co-authored-by: Carl Keene <[email protected]>
  • Loading branch information
2 people authored and judyjoseph committed Sep 2, 2021
1 parent be5236b commit 75ef115
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,9 @@ def tx_disable(self, tx_disable):
Returns:
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
cmdstatus, register = cmd.getstatusoutput('sudo i2cget -y 0 0x41 0x5')
if cmdstatus:
Expand Down Expand Up @@ -888,7 +891,7 @@ def get_name(self):
sfputil_helper = SfpUtilHelper()
sfputil_helper.read_porttab_mappings(
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

def get_presence(self):
Expand Down

0 comments on commit 75ef115

Please sign in to comment.