Skip to content

Commit 422687f

Browse files
authored
Fix fp_port_index error to get correct index type (sonic-net#111)
Always convert index to an int. Signed-off-by: Sangita Maity <[email protected]>
1 parent 7255d3a commit 422687f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sonic_platform_base/sonic_sfp/sfputilbase.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def read_porttab_mappings(self, porttabfile, asic_inst=0):
409409
logical_to_bcm[intf_name] = "xe"+ bcm_port
410410

411411
if 'index' in ports[intf_name].keys():
412-
fp_port_index = ports[intf_name]['index']
412+
fp_port_index = int(ports[intf_name]['index'])
413413
logical_to_physical[intf_name] = [fp_port_index]
414414

415415
if physical_to_logical.get(fp_port_index) is None:

sonic_platform_base/sonic_sfp/sfputilhelper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def read_porttab_mappings(self, porttabfile, asic_inst=0):
7979
bcm_port = str(port_pos_in_file)
8080

8181
if 'index' in ports[intf_name].keys():
82-
fp_port_index = ports[intf_name]['index']
82+
fp_port_index = int(ports[intf_name]['index'])
8383
logical_to_physical[intf_name] = [fp_port_index]
8484

8585
if physical_to_logical.get(fp_port_index) is None:

0 commit comments

Comments
 (0)