Skip to content

Commit

Permalink
sonic_sfp: avoid possible key error in get_physical_to_logical() (#37)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
ds952811 authored and jleveque committed Jul 2, 2019
1 parent 56b5b14 commit 9d27f36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sonic_sfp/sfputilbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def read_phytab_mappings(self, phytabfile):
def get_physical_to_logical(self, port_num):
"""Returns list of logical ports for the given physical port"""

return self.physical_to_logical[port_num]
return self.physical_to_logical.get(port_num)

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

0 comments on commit 9d27f36

Please sign in to comment.