Skip to content

Commit

Permalink
sfpshow: prevent 'show int trans eeprom --dom' from crashing (sonic-n…
Browse files Browse the repository at this point in the history
…et#567)

When some specific 25G DAC attached to the system, the 'dom_info_dict'
could be a None object, as a result, the 'show int transceiver eeprom --dom'
will crash.

And thus, in this commit, we'll add an additional checker for the None object.

Signed-off-by: Dante (Kuo-Jung) Su <dante.su@broadcom.com>
Change-Id: Ic2b5eb38ddf98b98cce7eddf161595013a19c720
  • Loading branch information
ds952811 authored and jleveque committed Jul 25, 2019
1 parent 8810864 commit b9d962d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/sfpshow
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class SFPShow(object):
out_put=''
ident = ' '
for key in sorted_key_table:
if dom_info_dict[key] != 'N/A':
if dom_info_dict is not None and dom_info_dict[key] != 'N/A':
if dom_info_dict[key] == 'Unknown':
out_put = out_put + ident + ident + channel_monitor_map[key] + ': ' + dom_info_dict[key] + '\n'
else:
Expand Down

0 comments on commit b9d962d

Please sign in to comment.