[yang]: Update yang models to support 'cluster' (#9806)

Why I did it
Minigraph parser added a new field 'cluster' to device_metadata, and then yang validation is blocked.

How I did it
Add 'cluster' to device_metadata yang models.

How to verify it
Run UT for sonc-yang-models.
Use minigraph parser to generate ConfigDB schema and run yang validation.

Signed-off-by: Gang Lv ganglv@microsoft.com
This commit is contained in:
ganglv 2022-01-26 13:02:47 +08:00 committed by GitHub
parent 533471231a
commit a04da0456b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 70 additions and 53 deletions

View File

@ -67,6 +67,9 @@
"DEVICE_METADATA_RESOURCE_TYPE_CONFIG": {
"desc": "Verifying resource type configuration."
},
"DEVICE_METADATA_VALID_CLUSTER": {
"desc": "Verifying valid cluster configuration."
},
"DEVICE_METADATA_VALID_SUBTYPE": {
"desc": "Verifying valid subtype value"
},

View File

@ -178,6 +178,15 @@
}
}
},
"DEVICE_METADATA_VALID_CLUSTER": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"cluster": "AAA00PrdStr00"
}
}
}
},
"DEVICE_METADATA_VALID_SUBTYPE": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {

View File

@ -135,6 +135,11 @@ module sonic-device_metadata {
type string;
}
leaf cluster {
type string;
description "The switch is a member of this cluster.";
}
leaf subtype {
type string {
pattern "DualToR";