Skip to content

Commit

Permalink
remove unnecessary loop code
Browse files Browse the repository at this point in the history
  • Loading branch information
keboliu committed Apr 3, 2020
1 parent 6c9de9d commit 3cef25c
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,19 +454,6 @@ def get_change_event(self, timeout=0):
status = self.sfp_event.check_sfp_status(port_dict, timeout)

if status:
# get_change_event has the meaning of retrieving all the notifications through a single call.
# Typically this is implemented via a select framework which requires the underlay file-reading
# interface able to retrieve all notifications without blocking once the fd has been selected.
# However, sdk doesn't provide any interface satisfied the requirement. as a result,
# check_sfp_status returns only one notification may indicate more notifications in its queue.
# In this sense, we have to iterate in a loop to get all the notifications in case that
# the first call returns at least one.
i = 0
while i < self.MAX_SELECT_EVENT_RETURNED:
status = self.sfp_event.check_sfp_status(port_dict, 0)
if not status:
break
i = i + 1
return True, {'sfp':port_dict}
else:
return True, {'sfp':{}}
Expand Down

0 comments on commit 3cef25c

Please sign in to comment.