Skip to content

Commit b9d962d

Browse files
ds952811jleveque
authored andcommitted
sfpshow: prevent 'show int trans eeprom --dom' from crashing (#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 <[email protected]> Change-Id: Ic2b5eb38ddf98b98cce7eddf161595013a19c720
1 parent 8810864 commit b9d962d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/sfpshow

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class SFPShow(object):
7575
out_put=''
7676
ident = ' '
7777
for key in sorted_key_table:
78-
if dom_info_dict[key] != 'N/A':
78+
if dom_info_dict is not None and dom_info_dict[key] != 'N/A':
7979
if dom_info_dict[key] == 'Unknown':
8080
out_put = out_put + ident + ident + channel_monitor_map[key] + ': ' + dom_info_dict[key] + '\n'
8181
else:

0 commit comments

Comments
 (0)