-
Notifications
You must be signed in to change notification settings - Fork 650
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
YANG Validation for MCLAG, NAT, MUXCABLE tables #2755
Conversation
Please add this PR to your HLD PR's description code PR list, so people can find relevant HLD. |
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])) |
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.
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.
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
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.
Thanks for your contribution to fix a bug in codebase!
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>') |
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.
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.
yes, corrected the typo now
import ipaddress | ||
|
||
import jsonpatch | ||
from jsonpatch import JsonPatchConflict |
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.
Can you use the same import method?
"import jsonpatch" or "from jsonpatch import xxx"
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.
cleaned import statement
import jsonpatch | ||
import jsonpointer | ||
from jsonpatch import JsonPatchConflict | ||
from jsonpointer import JsonPointerException |
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.
Please use the same import method
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.
cleaned import statements
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