[action] [PR:22445] Added slice_type in DEVICE_NEIGHBOR_METADATA yang model#1070
Merged
mssonicbld merged 1 commit intoAzure:202405from May 1, 2025
Merged
Conversation
What I did: This PR is continuation of sonic-net/sonic-buildimage#19094 where `slice_type` was added for DEVICE_METADATA. In this PR we are adding this DEVICE_NEIGHBOR_METADATA also. Why I did: Without this change Yang Validation fails when doing `config apply-patch` if this field is present in DEVICE_NEIGHBOR_METADATA ADO: 32574645 How I verify: Manual Verification Before fix: ``` echo '[]' | sudo config apply-patch /dev/stdin sonic_yang(3):All Keys are not parsed in DEVICE_NEIGHBOR_METADATA dict_keys(['xxxxx', 'xxxxx-lc02-ASIC00', 'xxxxx-lc02-ASIC01', 'xxxxx-lc02-ASIC02', 'xxxxx-sup00', 'xxxxx-sup00-ASIC00', 'xxxxx-sup00-ASIC01', 'xxxxx-sup00-ASIC04', 'xxxxx-sup00-ASIC05', 'xxxxx-sup00-ASIC08', 'xxxxx-sup00-ASIC09', 'xxxxx-sup00-ASIC10', 'xxxxx-sup00-ASIC11', 'xxxxx-sup00-ASIC12', 'xxxxx-sup00-ASIC13']) sonic_yang(3):exceptionList:["'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'"] sonic_yang(3):Data Loading Failed:All Keys are not parsed in DEVICE_NEIGHBOR_METADATA dict_keys(['xxxxx', 'xxxxx-lc02-ASIC00', 'xxxxx-lc02-ASIC01', 'xxxxx-lc02-ASIC02', 'xxxxx-sup00', 'xxxxx-sup00-ASIC00', 'xxxxx-sup00-ASIC01', 'xxxxx-sup00-ASIC04', 'xxxxx-sup00-ASIC05', 'xxxxx-sup00-ASIC08', 'xxxxx-sup00-ASIC09', 'xxxxx-sup00-ASIC10', 'xxxxx-sup00-ASIC11', 'xxxxx-sup00-ASIC12', 'xxxxx-sup00-ASIC13']) exceptionList:["'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'"] Failed to apply patch due to: Validate json patch: [] failed due to:Data Loading Failed All Keys are not parsed in DEVICE_NEIGHBOR_METADATA dict_keys(['xxxxx', 'xxxxx-lc02-ASIC00', 'xxxxx-lc02-ASIC01', 'xxxxx-lc02-ASIC02', 'xxxxx-sup00', 'xxxxx-sup00-ASIC00', 'xxxxx-sup00-ASIC01', 'xxxxx-sup00-ASIC04', 'xxxxx-sup00-ASIC05', 'xxxxx-sup00-ASIC08', 'xxxxx-sup00-ASIC09', 'xxxxx-sup00-ASIC10', 'xxxxx-sup00-ASIC11', 'xxxxx-sup00-ASIC12', 'xxxxx-sup00-ASIC13']) exceptionList:["'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'"] Usage: config apply-patch [OPTIONS] PATCH_FILE_PATH Try "config apply-patch -h" for help. Error: Validate json patch: [] failed due to:Data Loading Failed All Keys are not parsed in DEVICE_NEIGHBOR_METADATA dict_keys(['xxxxx', 'xxxxx-lc02-ASIC00', 'xxxxx-lc02-ASIC01', 'xxxxx-lc02-ASIC02', 'xxxxx-sup00', 'xxxxx-sup00-ASIC00', 'xxxxx-sup00-ASIC01', 'xxxxx-sup00-ASIC04', 'xxxxx-sup00-ASIC05', 'xxxxx-sup00-ASIC08', 'xxxxx-sup00-ASIC09', 'xxxxx-sup00-ASIC10', 'xxxxx-sup00-ASIC11', 'xxxxx-sup00-ASIC12', 'xxxxx-sup00-ASIC13']) exceptionList:["'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'", "'slice_type'"] ``` After fix: ``` echo '[]' | sudo config apply-patch /dev/stdin Patch Applier: localhost: Patch application starting. Patch Applier: localhost: Patch: [] Patch Applier: localhost getting current config db. Patch Applier: localhost: simulating the target full config after applying the patch. Patch Applier: localhost: validating all JsonPatch operations are permitted on the specified fields Patch Applier: localhost: validating target config does not have empty tables, since they do not show up in ConfigDb. Patch Applier: localhost: sorting patch updates. Patch Applier: The localhost patch was converted into 0 changes. Patch Applier: localhost: applying 0 changes in order. Patch Applier: localhost: verifying patch updates are reflected on ConfigDB. Patch Applier: localhost patch application completed. Patch Applier: asic0: Patch application starting. Patch Applier: asic0: Patch: [] Patch Applier: asic0 getting current config db. Patch Applier: asic0: simulating the target full config after applying the patch. Patch Applier: asic0: validating all JsonPatch operations are permitted on the specified fields Patch Applier: asic0: validating target config does not have empty tables, since they do not show up in ConfigDb. Patch Applier: asic0: sorting patch updates. Patch Applier: The asic0 patch was converted into 0 changes. Patch Applier: asic0: applying 0 changes in order. Patch Applier: asic0: verifying patch updates are reflected on ConfigDB. Patch Applier: asic0 patch application completed. Patch Applier: asic1: Patch application starting. Patch Applier: asic1: Patch: [] Patch Applier: asic1 getting current config db. Patch Applier: asic1: simulating the target full config after applying the patch. Patch Applier: asic1: validating all JsonPatch operations are permitted on the specified fields Patch Applier: asic1: validating target config does not have empty tables, since they do not show up in ConfigDb. Patch Applier: asic1: sorting patch updates. Patch Applier: The asic1 patch was converted into 0 changes. Patch Applier: asic1: applying 0 changes in order. Patch Applier: asic1: verifying patch updates are reflected on ConfigDB. Patch Applier: asic1 patch application completed. Patch Applier: asic2: Patch application starting. Patch Applier: asic2: Patch: [] Patch Applier: asic2 getting current config db. Patch Applier: asic2: simulating the target full config after applying the patch. Patch Applier: asic2: validating all JsonPatch operations are permitted on the specified fields Patch Applier: asic2: validating target config does not have empty tables, since they do not show up in ConfigDb. Patch Applier: asic2: sorting patch updates. Patch Applier: The asic2 patch was converted into 0 changes. Patch Applier: asic2: applying 0 changes in order. Patch Applier: asic2: verifying patch updates are reflected on ConfigDB. Patch Applier: asic2 patch application completed. Patch applied successfully. ``` UT updated.
Collaborator
Author
|
Original PR: sonic-net/sonic-buildimage#22445 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
bingwang-ms
pushed a commit
that referenced
this pull request
Jan 16, 2026
…omatically (#24233) #### Why I did it src/sonic-swss-common ``` * 130d8b6 - (HEAD -> master, origin/master, origin/HEAD) Add chassis db. (#1085) (67 minutes ago) [dypet] * 66e437a - Fix mocktests for buster builds (#1087) (3 days ago) [prabhataravind] * 32b14a4 - Update static database_config.json in swsscommon (#1086) (4 days ago) [prabhataravind] * c253917 - Add pop batch size support for ZMQ Consumer (#1084) (5 days ago) [Vivek] * 4fea06e - [sonic-db-cli] Add flag to make cli calls to container databases (#1070) (6 days ago) [Connor Roos] ``` #### How I did it #### How to verify it #### Description for the changelog
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:
This PR is continuation of sonic-net/sonic-buildimage#19094 where
slice_typewas added for DEVICE_METADATA. In this PR we are adding this DEVICE_NEIGHBOR_METADATA also.Why I did:
Without this change Yang Validation fails when doing
config apply-patchif this field is present in DEVICE_NEIGHBOR_METADATAADO: 32574645
How I verify:
Manual Verification
Before fix:
After fix:
UT updated.