Skip to content

Commit

Permalink
Fix fp_port_index error to get correct index type (sonic-net#111)
Browse files Browse the repository at this point in the history
Always convert index to an int.

Signed-off-by: Sangita Maity <[email protected]>
  • Loading branch information
samaity authored Sep 24, 2020
1 parent 7255d3a commit 422687f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_sfp/sfputilbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def read_porttab_mappings(self, porttabfile, asic_inst=0):
logical_to_bcm[intf_name] = "xe"+ bcm_port

if 'index' in ports[intf_name].keys():
fp_port_index = ports[intf_name]['index']
fp_port_index = int(ports[intf_name]['index'])
logical_to_physical[intf_name] = [fp_port_index]

if physical_to_logical.get(fp_port_index) is None:
Expand Down
2 changes: 1 addition & 1 deletion sonic_platform_base/sonic_sfp/sfputilhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def read_porttab_mappings(self, porttabfile, asic_inst=0):
bcm_port = str(port_pos_in_file)

if 'index' in ports[intf_name].keys():
fp_port_index = ports[intf_name]['index']
fp_port_index = int(ports[intf_name]['index'])
logical_to_physical[intf_name] = [fp_port_index]

if physical_to_logical.get(fp_port_index) is None:
Expand Down

0 comments on commit 422687f

Please sign in to comment.