[GCU] Copying config_db before calling sonic_yang.loadData#1983
Merged
ghooo merged 1 commit intosonic-net:masterfrom Dec 27, 2021
Merged
[GCU] Copying config_db before calling sonic_yang.loadData#1983ghooo merged 1 commit intosonic-net:masterfrom
ghooo merged 1 commit intosonic-net:masterfrom
Conversation
Contributor
|
Could you explain your motivation in PR description? Is it a bug fix or refactoring? |
6b8cb79 to
0218a83
Compare
ghooo
commented
Dec 27, 2021
Contributor
Author
There was a problem hiding this comment.
Adding __str__ and __repr__ are not related to this PR, but they are small improvements to the Diff class.
efdddff to
2374d73
Compare
2374d73 to
e96fd8c
Compare
qiluo-msft
approved these changes
Dec 27, 2021
judyjoseph
pushed a commit
that referenced
this pull request
Jan 9, 2022
#### What I did Adding unit-test for cases where `PatchSorter.sort` is called to update config that has tables without YANG. This would sometimes throw the error ``` KeyError: 'NameOfTableWithoutYang' ``` This error happened because `find_ref_paths` would remove tables without yang as a side-effect. Earlier this was fixed by cropping tables without yang models from current and target configs. That fix had 2 issues: - It is not addressing the real problem which is cropping the config as a side effect to `find_ref_paths` - If the move generated by the inner logic of `PatchSorter` was to replace whole config, it would result in replacing whole config with the config with cropped non-yang tables #### How I did it - Fixing `find_ref_paths` to not crop the given config as a side-effect - Added a unit-test for that - Revert the change to crop current config and target config in `PatchSorter.sort` - Added a unit-test to verify replace whole config move does not result unintentionally in removing tables without yang - Added unit-test to verify calling `PatchSorter.sort` on a config with non-yang tables does not result in the exception: ``` KeyError: 'NameOfTableWithoutYang' ``` #### How to verify it unit-tests #### Previous command output (if the output of a command-line utility has changed) #### New command output (if the output of a command-line utility has changed)
dbarashinvd
pushed a commit
to dbarashinvd/sonic-utilities
that referenced
this pull request
Jul 11, 2022
…t#1983) #### What I did Adding unit-test for cases where `PatchSorter.sort` is called to update config that has tables without YANG. This would sometimes throw the error ``` KeyError: 'NameOfTableWithoutYang' ``` This error happened because `find_ref_paths` would remove tables without yang as a side-effect. Earlier this was fixed by cropping tables without yang models from current and target configs. That fix had 2 issues: - It is not addressing the real problem which is cropping the config as a side effect to `find_ref_paths` - If the move generated by the inner logic of `PatchSorter` was to replace whole config, it would result in replacing whole config with the config with cropped non-yang tables #### How I did it - Fixing `find_ref_paths` to not crop the given config as a side-effect - Added a unit-test for that - Revert the change to crop current config and target config in `PatchSorter.sort` - Added a unit-test to verify replace whole config move does not result unintentionally in removing tables without yang - Added unit-test to verify calling `PatchSorter.sort` on a config with non-yang tables does not result in the exception: ``` KeyError: 'NameOfTableWithoutYang' ``` #### How to verify it unit-tests #### Previous command output (if the output of a command-line utility has changed) #### New command output (if the output of a command-line utility has changed)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Adding unit-test for cases where
PatchSorter.sortis called to update config that has tables without YANG. This would sometimes throw the errorThis error happened because
find_ref_pathswould remove tables without yang as a side-effect.Earlier this was fixed by cropping tables without yang models from current and target configs. That fix had 2 issues:
find_ref_pathsPatchSorterwas to replace whole config, it would result in replacing whole config with the config with cropped non-yang tablesHow I did it
find_ref_pathsto not crop the given config as a side-effectPatchSorter.sortPatchSorter.sorton a config with non-yang tables does not result in the exception:How to verify it
unit-tests
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)