YANG Validation for ConfigDB Updates: TACPLUS, TACPLUS_SERVER, AAA, VLAN_SUB_INTERFACE tables + decorated validated_mod_entry#2452
Conversation
|
This pull request introduces 1 alert when merging b4f466d into c2841b8 - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging c3544a2 into 7e7d05c - view on LGTM.com new alerts:
|
| value = cleaned_value | ||
| add_patch_entry() | ||
| else: | ||
| add_patch_entry() |
There was a problem hiding this comment.
set_entry and mod_entry both use jsonpatch add op.
The difference between set_entry and mod_entry is that set_entry will remove extra fields in the db which are not in the data. So this difference is captured by differing paths in the jsonpatch. The path for mod_entry is more granular.
There was a problem hiding this comment.
set_entry is not able to be directly translated to jsonpatch replace op because replace does not allow for addition of a field that does not already exist.
For example, if we try to add a new portchannel, we will get the following error:
admin@vlab-01:~$ sudo config apply-patch patch.json
Patch Applier: Patch application starting.
Patch Applier: Patch: [{"op": "replace", "path": "/PORTCHANNEL/PortChannel04", "value": {"admin_status": "up", "mtu": "9100", "lacp_key": "auto", "min_links": "1"}}]
Patch Applier: Getting current config db.
Patch Applier: Simulating the target full config after applying the patch.
Failed to apply patch
Usage: config apply-patch [OPTIONS] PATCH_FILE_PATH
Try "config apply-patch -h" for help.
Error: can't replace a non-existent object 'PortChannel04'
|
@preetham-singh Could you help review? |
|
This pull request introduces 1 alert when merging b20dfb9 into 7e7d05c - view on LGTM.com new alerts:
|
|
This pull request introduces 2 alerts when merging 650e723 into 4a3d49d - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 18a5e1a into 4a3d49d - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 0bc9fa7 into 4a3d49d - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 3ce3dbc into e8b1dcd - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 5899db9 into e8b1dcd - view on LGTM.com new alerts:
|
|
This pull request introduces 1 alert when merging 08ee911 into e8b1dcd - view on LGTM.com new alerts:
|
08ee911 to
5899db9
Compare
|
This pull request introduces 1 alert when merging d945fb2 into e8b1dcd - view on LGTM.com new alerts:
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
I see a new lgtm alert. |
…LAN_SUB_INTERFACE tables + decorated validated_mod_entry (sonic-net#2452)
…LAN_SUB_INTERFACE tables + decorated validated_mod_entry (sonic-net#2452)
What I did
-Add YANG validation using GCU for writes to TACPLUS, TACPLUS_SERVER, AAA, VLAN_SUB_INTERFACE in ConfigDB
-decorate mod_entry with validated_mod_entry to include YANG validation
-process all values in GCU JsonPatch, convert to string
How I did it
Using same method as https://github.com/sonic-net/sonic-utilities/pull/2190/files, extend to TACPLUS, TACPLUS_SERVER, AAA, VLAN_SUB_INTERFACE use cases
How to verify it
Verified testing CLI on virtual switch