-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sonic-cfggen] Fix sonic-cfggen crash issue when printing non-exists table/key #4131
base: master
Are you sure you want to change the base?
Conversation
06d47b5
to
b71c240
Compare
@zhenggen-xu , it looks like your proposed change breaks the test. I do not whether we should change the test or your patch. any opinion? |
@lguohan it looks like the upstream merge broke some changes: changed to: We need revert that line and see. |
…'t fail if no WARM_RESTART in configDB In general, instead of sonic-cfggen crashing we print empty string if we use -v or --var-json for variables not existing Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
15dff30
Just reverted the merge issue and let's see the results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest to use is not None
instead of != None
…table/key Address review feedback Signed-off-by: Zhenggen Xu <zxu@linkedin.com>
In general, I might want to leave that to different PR, as the fix here was to handle exceptions not fixing existing style issue. I see many places in the file using "!= None", we probably should have some PR to address them all together. Anyway, I changed it so to get the PR moving forward. |
Your code catches all exceptions. How can we find an issue if we have one? I'd suggest you to make |
This should be back-ported to 201911 and 201811 branches too.
- What I did
If the configDB has no warm-restart configurations, the start.sh in bgp docker would fail due to python exception as below:
- How I did it
Check the WARM_RESTART table first. If does not exist, won't check the bgp_eoiu info to avoid crash.
- How to verify it
After the fix:
Additional tests:
Before fix:
After fix:
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)