Skip to content

Commit

Permalink
[xcvrd] Don't log unnecessary messages upon empty transceiver change …
Browse files Browse the repository at this point in the history
…event (#53)

When port_dict of transceiver_change is empty, do nothing rather than log messages like
```
xcvrd: Got event True {} in state 1
xcvrd: mapping from True {'-1': 'system_become_ready'} to system_become_ready
xcvrd: Got system_become_ready in normal state, ignored
```
  • Loading branch information
chiourung authored Sep 9, 2020
1 parent 65fa443 commit 7f812c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sonic-xcvrd/scripts/xcvrd
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,8 @@ class SfpStateUpdateTask(object):
next_state = state
time_start = time.time()
status, port_dict = _wrapper_get_transceiver_change_event(timeout)
if not port_dict:
continue
helper_logger.log_debug("Got event {} {} in state {}".format(status, port_dict, state))
event = self._mapping_event_from_change_event(status, port_dict)
if event == SYSTEM_NOT_READY:
Expand Down

0 comments on commit 7f812c9

Please sign in to comment.