File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 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):
264264 output += '{}{}: {}\n ' .format (indent , QSFP_DATA_MAP [key ], sfp_info_dict [key ])
265265 else :
266266 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 )
269272 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 ))
271276 else :
272277 output += '{}{}: {}\n ' .format (indent , QSFP_DATA_MAP [key ], sfp_info_dict [key ])
273278
You can’t perform that action at this time.
0 commit comments