Skip to content

Added slice_type in DEVICE_NEIGHBOR_METADATA yang model#22445

Merged
rlhui merged 16 commits intosonic-net:masterfrom
abdosi:frr-patch
Apr 28, 2025
Merged

Added slice_type in DEVICE_NEIGHBOR_METADATA yang model#22445
rlhui merged 16 commits intosonic-net:masterfrom
abdosi:frr-patch

Conversation

@abdosi
Copy link
Contributor

@abdosi abdosi commented Apr 26, 2025

What I did:

This PR is continuation of #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.

abdosi and others added 16 commits November 4, 2024 19:05
via NETLINK RTA_PRIORITY field which can be used as attribute/metadata
in fpmsyncd for different use-cases.

Signed-off-by: Abhishek Dosi <[email protected]>
…K RTA_PRIORITY field which can be used as attribute/metadata in fpmsyncd for different use-cases.

Signed-off-by: Abhishek Dosi <[email protected]>
…a NETLINK RTA_PRIORITY field which can be used as attribute/metadata in fpmsyncd for different use-cases."

This reverts commit 2776138.
This reverts commit b78ad9b.
Signed-off-by: Abhishek Dosi <[email protected]>
Signed-off-by: Carmine Scarpitta <[email protected]>
@abdosi abdosi requested a review from qiluo-msft as a code owner April 26, 2025 02:17
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@abdosi abdosi requested a review from arlakshm April 26, 2025 02:17
@abdosi abdosi changed the title Frr patch Added slice_type in DEVICE_NEIGHBOR_METADATA yang model Apr 26, 2025
@abdosi
Copy link
Contributor Author

abdosi commented Apr 26, 2025

@arlakshm : needed in 202405 also.

@qiluo-msft
Copy link
Collaborator

@arlakshm Could you also help review?

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202405: Azure/sonic-buildimage-msft#1070

@mssonicbld
Copy link
Collaborator

Cherry-pick PR to msft-202503: Azure/sonic-buildimage-msft#1331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants