01-31-2025 03:18 PM - edited 02-07-2025 07:40 AM
Hi,
I'm trying to build a ned using NSO 6.4, but compilation is failing due to my deviation file.
From devel.log, I have this error:
ncs progress usid=35 tid=1084 datastore=running context=cli trace-id=d5aafe3da82cf16c52206216ecfb575b output: augmented/oc-platform-deviations@2024-07-01.yang:270: error: the node is config, but refers to a non-config leaf 'name' in module 'openconfig-platform' defined at augmented/openconfig-platform@2024-05-29.yang:2703
which is not what I was expecting, as I'm changing the whole list to config false in my deviation file.
This is the list I'm trying to change:
grouping platform-subcomponent-ref-top {
description
"Top-level grouping for list of subcomponent references";
container subcomponents {
description
"Enclosing container for subcomponent references";
list subcomponent {
key "name";
description
"List of subcomponent references";
leaf name {
type leafref {
path "../config/name";
}
description
"Reference to the name list key";
}
container config {
description
"Configuration data for the subcomponent";
uses platform-subcomponent-ref-config;
}
container state {
config false;
description
"Operational state data for the subcomponent";
uses platform-subcomponent-ref-config;
uses platform-subcomponent-ref-state;
}
}
}
}
And this is the relevant part of my deviation file:
deviation /oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent{
deviate replace {
config false;
}
}
deviation /oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:name {
deviate replace {
type leafref {
path "../oc-platform:state/oc-platform:name";
}
}
}
deviation /oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:config {
deviate not-supported;
}
Looking through augmented/oc-platform-deviations@2024-07-01.yang, I have a bunch of "NCS drop config false deviate replace":
deviation "/ncs:compliance/ncs:template/ncs:ned-id/ncs:config/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent" {
// NCS drop config false deviate replace
}
deviation "/ncs:devices/ncs:template/ncs:ned-id/ncs:config/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent" {
// NCS drop config false deviate replace
}
deviation "/ncs:devices/ncs:device/ncs:live-status/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent" {
deviate replace;
}
deviation "/ncs:devices/ncs:device/ncs:config/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent" {
// NCS drop config false deviate replace
}
deviation "/ncs:compliance/ncs:template/ncs:ned-id/ncs:config/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:name" {
deviate replace {
type string;
}
}
deviation "/ncs:devices/ncs:template/ncs:ned-id/ncs:config/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:name" {
deviate replace {
type string;
}
}
deviation "/ncs:devices/ncs:device/ncs:live-status/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:name" {
deviate replace {
type leafref {
path "/ncs:devices/ncs:device/ncs:live-status/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:state/oc-platform:name" {
tailf:xpath-root 3;
}
}
}
}
deviation "/ncs:devices/ncs:device/ncs:config/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:name" {
deviate replace {
type leafref {
path "/ncs:devices/ncs:device/ncs:live-status/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:state/oc-platform:name" {
tailf:xpath-root 2;
}
}
}
}
deviation "/ncs:compliance/ncs:template/ncs:ned-id/ncs:config/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:config" {
deviate not-supported;
}
deviation "/ncs:devices/ncs:template/ncs:ned-id/ncs:config/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:config" {
deviate not-supported;
}
deviation "/ncs:devices/ncs:device/ncs:live-status/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:config" {
deviate not-supported;
}
deviation "/ncs:devices/ncs:device/ncs:config/oc-platform:components/oc-platform:component/oc-platform:subcomponents/oc-platform:subcomponent/oc-platform:config" {
deviate not-supported;
}
Why is this happening? Is this operation invalid? I didn't find any question like this in the forums. The closest one is this, but it doesn't apply to my case as I'm not trying to deviate a config to true.
If I change the original list directly to have config false the build-ned command runs without a problem.
04-02-2025 05:30 AM
the yang spec doesn't allow leafref on config node pointing to oper node https://www.rfc-editor.org/rfc/rfc6020.html#section-9.9.2, thus the compiler error.
the config false deviation are dropped because config false nodes in those subtrees don't make sense.
I can only suggest you request oc to fix their models, or as you did fix the models directly(but I don't know if the list should be config true or false)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide