File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -264,10 +264,15 @@ def convert_sfp_info_to_output_string(sfp_info_dict):
264
264
output += '{}{}: {}\n ' .format (indent , QSFP_DATA_MAP [key ], sfp_info_dict [key ])
265
265
else :
266
266
output += '{}{}:\n ' .format (indent , QSFP_DATA_MAP ['specification_compliance' ])
267
- spefic_compliance_dict = eval (sfp_info_dict ['specification_compliance' ])
268
- sorted_compliance_key_table = natsorted (spefic_compliance_dict )
267
+
268
+ spec_compliance_dict = {}
269
+ try :
270
+ spec_compliance_dict = ast .literal_eval (sfp_info_dict ['specification_compliance' ])
271
+ sorted_compliance_key_table = natsorted (spec_compliance_dict )
269
272
for compliance_key in sorted_compliance_key_table :
270
- output += '{}{}: {}\n ' .format ((indent * 2 ), compliance_key , spefic_compliance_dict [compliance_key ])
273
+ output += '{}{}: {}\n ' .format ((indent * 2 ), compliance_key , spec_compliance_dict [compliance_key ])
274
+ except ValueError as e :
275
+ output += '{}N/A\n ' .format ((indent * 2 ))
271
276
else :
272
277
output += '{}{}: {}\n ' .format (indent , QSFP_DATA_MAP [key ], sfp_info_dict [key ])
273
278
You can’t perform that action at this time.
0 commit comments