Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix key error caused by platform_asic (#9547)
Description of PR In PR #9054, it will try to get duthost.facts["platform_asic"] in test_crm.py, but in file tests/common/devices/sonic.py, which define the duthost.facts, platform_asic may not exist in duthost.facts. And this will cause KeyError in test_crm.py. In this PR, if platform_asic doesn't exist in duthost.facts, we set it None. What is the motivation for this PR? In PR #9054, it will try to get duthost.facts["platform_asic"] in test_crm.py, but in file tests/common/devices/sonic.py, which define the duthost.facts, platform_asic may not exist in duthost.facts. And this will cause KeyError in test_crm.py. In this PR, if platform_asic doesn't exist in duthost.facts, we set it None. Signed-off-by: Yutong Zhang <yutongzhang@microsoft.com>
- Loading branch information