Skip to content

Commit 9d27f36

Browse files
ds952811jleveque
authored andcommitted
sonic_sfp: avoid possible key error in get_physical_to_logical() (#37)
This is part of PR#31 of sonic-platform-daemons, there could be a key error in get_physical_to_logical() in SFP monitor due to a timing issue, and it will later be recovered automatically. Signed-off-by: Dante (Kuo-Jung) Su <[email protected]>
1 parent 56b5b14 commit 9d27f36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sonic_sfp/sfputilbase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def read_phytab_mappings(self, phytabfile):
544544
def get_physical_to_logical(self, port_num):
545545
"""Returns list of logical ports for the given physical port"""
546546

547-
return self.physical_to_logical[port_num]
547+
return self.physical_to_logical.get(port_num)
548548

549549
def get_logical_to_physical(self, logical_port):
550550
"""Returns list of physical ports for the given logical port"""

0 commit comments

Comments
 (0)