You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sonic-snmp.yang defines leaf Contact, but sonic-utilities writes to ConfigDB with key {contact name}. So YANG validation fails when the key is {contact name} and not the string "Contact"
leaf Contact {
type string {
length "1..255";
}
description
"SNMP System Contact.";
}
Steps to reproduce the issue:
Create JsonPatch to write to SNMP contact field. Sample JsonPatch:
Using GCU with JsonPatch above, attempt to update SNMP contact field
admin@vlab-01:~$ sudo config apply-patch patch.json
Patch Applier: Patch application starting.
Patch Applier: Patch: [{"op": "add", "path": "/SNMP/CONTACT", "value": {}}, {"op": "add", "path": "/SNMP/CONTACT/joe", "value": "joe@contoso.com"}]
Patch Applier: Getting current config db.
Patch Applier: Simulating the target full config after applying the patch.
Patch Applier: Validating target config does not have empty tables, since they do not show up in ConfigDb.
Patch Applier: Sorting patch updates.
Failed to apply patch
Usage: config apply-patch [OPTIONS] PATCH_FILE_PATH
Try "config apply-patch -h" for help.
Error: Given patch will produce invalid config. Error: Data Loading Failed
All Keys are not parsed in SNMP
dict_keys(['joe'])
exceptionList:[]
Describe the results you received:
Failed application of JsonPatch, unable to write to SNMP contact field
Describe the results you expected:
Successful application of JsonPatch
The text was updated successfully, but these errors were encountered:
As per RFC3418 sysContact is defined as follows. Why doe we need to create contact with key?.
sysContact OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The textual identification of the contact person for
this managed node, together with information on how
to contact this person. If no contact information is
known, the value is the zero-length string."
::= { system 4 }
Description
sonic-snmp.yang defines leaf Contact, but sonic-utilities writes to ConfigDB with key {contact name}. So YANG validation fails when the key is {contact name} and not the string "Contact"
Steps to reproduce the issue:
Describe the results you received:
Failed application of JsonPatch, unable to write to SNMP contact field
Describe the results you expected:
Successful application of JsonPatch
The text was updated successfully, but these errors were encountered: