[sonic-py-common][device info] Check for None before accessing the ASIC type (#9290)

This commit is contained in:
Mahesh Maddikayala 2021-11-30 11:12:48 -08:00 committed by GitHub
parent 0908f9ec49
commit bfef686d64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -351,7 +351,8 @@ def get_platform_info():
hw_info_dict['platform'] = get_platform()
hw_info_dict['hwsku'] = get_hwsku()
hw_info_dict['asic_type'] = version_info['asic_type']
if version_info:
hw_info_dict['asic_type'] = version_info.get('asic_type')
hw_info_dict['asic_count'] = get_num_asics()
try: