YANG Validation for MCLAG, NAT, MUXCABLE tables#2755
Merged
isabelmsft merged 7 commits intosonic-net:masterfrom Apr 6, 2023
Merged
YANG Validation for MCLAG, NAT, MUXCABLE tables#2755isabelmsft merged 7 commits intosonic-net:masterfrom
isabelmsft merged 7 commits intosonic-net:masterfrom
Conversation
Contributor
|
Please add this PR to your HLD PR's description code PR list, so people can find relevant HLD. |
qiluo-msft
reviewed
Mar 30, 2023
| except ValueError as e: | ||
| ctx.fail("Invalid ConfigDB. Error: {}".format(e)) | ||
| else: | ||
| ctx.fail("only one mclag Domain can be configured. Already one domain {} configured ".format(list(mclag_domain_keys)[0])) |
Contributor
Contributor
Author
There was a problem hiding this comment.
Yes. Without the change, we get this error
File "/usr/local/lib/python3.9/dist-packages/config/mclag.py", line 161, in add_mclag_domain
print(mclag_domain_keys[0])
TypeError: 'dict_keys' object is not subscriptable
Contributor
There was a problem hiding this comment.
Thanks for your contribution to fix a bug in codebase!
qiluo-msft
reviewed
Mar 31, 2023
config/nat.py
Outdated
|
|
||
| # | ||
| # 'nat add binding' command ('config nat add binding <binding_name> <pool_name> <acl_name>') | ||
| # 'nat add binding' command ('config nat add binding <ninding_name> <pool_name> <acl_name>') |
Contributor
Contributor
Author
There was a problem hiding this comment.
yes, corrected the typo now
ganglyu
reviewed
Mar 31, 2023
ganglyu
reviewed
Mar 31, 2023
ganglyu
reviewed
Mar 31, 2023
| import ipaddress | ||
|
|
||
| import jsonpatch | ||
| from jsonpatch import JsonPatchConflict |
Contributor
There was a problem hiding this comment.
Can you use the same import method?
"import jsonpatch" or "from jsonpatch import xxx"
Contributor
Author
There was a problem hiding this comment.
cleaned import statement
ganglyu
reviewed
Mar 31, 2023
| import jsonpatch | ||
| import jsonpointer | ||
| from jsonpatch import JsonPatchConflict | ||
| from jsonpointer import JsonPointerException |
Contributor
There was a problem hiding this comment.
Please use the same import method
Contributor
Author
There was a problem hiding this comment.
cleaned import statements
ganglyu
reviewed
Mar 31, 2023
ganglyu
approved these changes
Apr 6, 2023
qiluo-msft
approved these changes
Apr 6, 2023
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
Add YANG validation using GCU for writes to MCLAG, NAT, MUXCABLE tables tables in ConfigDB
How I did it
Using same method as https://github.com/sonic-net/sonic-utilities/pull/2190/files, extend to MCLAG, NAT, MUXCABLE tables
How to verify it
verified testing on virtual switch CLI