Skip to content

[action] [PR:106] Fix hostcfgd crash when delete entire config table. (#106)#129

Merged
mssonicbld merged 1 commit intosonic-net:202311from
mssonicbld:cherry/202311/106
May 21, 2024
Merged

[action] [PR:106] Fix hostcfgd crash when delete entire config table. (#106)#129
mssonicbld merged 1 commit intosonic-net:202311from
mssonicbld:cherry/202311/106

Conversation

@mssonicbld
Copy link

What I did
Fix hostcfgd crash when delete entire config table.

Why I did it
hostcfgd subscribe table change in register_callbacks() method. When a config table been deleted, the 'data' parameter of callback method will be 'None', however most callback doesn't handle the 'None' case, they only handle empty dictionary case. when this happen hostcfgd will crash.

How I verified it
Pass all UT.
Add new UT for code coverage.

**What I did**
Fix hostcfgd crash when delete entire config table.

**Why I did it**
hostcfgd subscribe table change in register_callbacks() method. When a config table been deleted, the 'data' parameter of callback method will be 'None', however most callback doesn't handle the 'None' case, they only handle empty dictionary case. when this happen hostcfgd will crash.

**How I verified it**
Pass all UT.
Add new UT for code coverage.
@mssonicbld
Copy link
Author

Original PR: #106

@mssonicbld mssonicbld merged commit 860f386 into sonic-net:202311 May 21, 2024
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