[yang] Adding not-provisioned to type field in DEVICE_METADATA table (#9951)

#### Why I did it
Fixing the issue https://github.com/Azure/sonic-buildimage/issues/9915

#### How I did it
Added 'not-provisioned' as a supported value for type field in DEVICE_METADATA type. This value is set during initial ZTP bring up

#### How to verify it
Added UT to verify it.
This commit is contained in:
Sudharsan Dhamal Gopalarathnam 2022-02-10 11:59:25 -08:00 committed by GitHub
parent 09b0cc2cce
commit b621dafff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 1 deletions

View File

@ -36,6 +36,9 @@
"DEVICE_METADATA_TYPE_CORRECT_PATTERN": { "DEVICE_METADATA_TYPE_CORRECT_PATTERN": {
"desc": "DEVICE_METADATA correct value for Type field" "desc": "DEVICE_METADATA correct value for Type field"
}, },
"DEVICE_METADATA_TYPE_NOT_PROVISIONED_PATTERN": {
"desc": "DEVICE_METADATA value as not-provisioned for Type field"
},
"DEVICE_METADATA_DEFAULT_SYNCHRONOUS_MODE": { "DEVICE_METADATA_DEFAULT_SYNCHRONOUS_MODE": {
"desc": "DEVICE_METADATA DEFAULT VALUE FOR SYNCHRONOUS MODE.", "desc": "DEVICE_METADATA DEFAULT VALUE FOR SYNCHRONOUS MODE.",
"eStrKey" : "Verify", "eStrKey" : "Verify",

View File

@ -54,6 +54,16 @@
} }
} }
}, },
"DEVICE_METADATA_TYPE_NOT_PROVISIONED_PATTERN": {
"sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": {
"sonic-device_metadata:localhost": {
"bgp_asn": "65002",
"type": "not-provisioned"
}
}
}
},
"DEVICE_METADATA_DEFAULT_SYNCHRONOUS_MODE": { "DEVICE_METADATA_DEFAULT_SYNCHRONOUS_MODE": {
"sonic-device_metadata:sonic-device_metadata": { "sonic-device_metadata:sonic-device_metadata": {
"sonic-device_metadata:DEVICE_METADATA": { "sonic-device_metadata:DEVICE_METADATA": {

View File

@ -88,7 +88,7 @@ module sonic-device_metadata {
leaf type { leaf type {
type string { type string {
length 1..255; length 1..255;
pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|MgmtToRRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR"; pattern "ToRRouter|LeafRouter|SpineChassisFrontendRouter|ChassisBackendRouter|ASIC|MgmtToRRouter|SpineRouter|BackEndToRRouter|BackEndLeafRouter|EPMS|MgmtTsToR|not-provisioned";
} }
} }