Skip to content

[action] [PR:9547] Fix KeyError caused by PR #9054. #9686

Merged
mssonicbld merged 1 commit intosonic-net:202205from
mssonicbld:cherry/202205/9547
Aug 28, 2023
Merged

[action] [PR:9547] Fix KeyError caused by PR #9054. #9686
mssonicbld merged 1 commit intosonic-net:202205from
mssonicbld:cherry/202205/9547

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

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.

Summary:
Fixes #9054

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 201911
  • 202012
  • 202205

Approach

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.

How did you do it?

How did you verify/test it?

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

Description of PR
In PR sonic-net#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 sonic-net#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 <[email protected]>
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: #9547

@mssonicbld mssonicbld merged commit b9f1869 into sonic-net:202205 Aug 28, 2023
@mssonicbld mssonicbld deleted the cherry/202205/9547 branch February 4, 2024 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants