sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

[SNMP:Contact] Fix for config replace failure with SNMP Contact issue

Open Verma-Anukul opened this issue 1 year ago • 0 comments

==> Issue: • Config replace/yang-validation fails for SNMP contact configuration. • In SNMP contact CLI, email field is mandatory Related to https://github.com/sonic-net/sonic-buildimage/issues/12620

==> Root Cause: • sonic-snmp.yang defines leaf Contact, but sonic-utilities (CLI backend) writes to ConfigDB with key {contact_name}. So YANG validation fails when the key is {contact_name} and not the string "Contact" • CLI current implementation is expecting two mandatory arguments

==> Fix: • sonic-utilities (CLI backend) code is updated to use Yang leaf name "Contact" string as key and user passed input as "value" • CLI implementation (sonic-utilities) is changed to expect only a single string, where user can pass any string of choice (name, email, phone, address or combination of these). Accordingly, "show" CLIs will display only "contact" instead of "name" & "email"

Migration script is updated to take care of config_db migration Tests:

Test CLIs manually Test config replace Test config migration

PRs : sonic-buildimage - https://github.com/sonic-net/sonic-buildimage/pull/19834 sonic-utilities - https://github.com/sonic-net/sonic-utilities/pull/3476 SONiC (docs) - https://github.com/sonic-net/SONiC/pull/1774

Signed-off-by: Anukul Verma [email protected]

Verma-Anukul avatar Aug 06 '24 13:08 Verma-Anukul