Hi Guys
I noticed different behavior of xpath on leaf and on when statement. In particular, i've created a yang file with one leaf that identify a switch model trough xpath and one choice statement with "when condition" about model
When I using xpath on when condition statement, it's possibile to use xpath reference about
"show devices device <<NAME DEVICE>> platform model;
When i using xpath on leaf with learef, it's must use
"show runnning devices device <<NAME device>> config ios.."
If I using a show device device xpath on leafref, when i lanch a make command i've a following error
yang/GigaBiz.yang:80: error: the node is config, but refers to a non-config leaf 'model' defined at /home/nso/NSO-4.3.6/src/ncs/yang/tailf-ncs-devices.yang:2865
My code is showing in following tab
leaf device_type {
tailf:info "leaf per identificare la tipologia di NT ";
type leafref {
/* path "/ncs:devices/ncs:device[ncs:name=current()/../NT]/ncs:config/ios:hostname";*/
path "/ncs:devices/ncs:device[ncs:name=current()/../NT]/ncs:platform/ncs:model";
}
}
... cut ...
choice interface_nt_tir {
case gig {
when "/ncs:devices/ncs:device[ncs:name=current()/NT]/ncs:platform/ncs:model = 'ME-3400G-12CS-A'";
leaf if_gig_nt_tir {
mandatory true;
type leafref {
path "/ncs:devices/ncs:device[ncs:name=current()/../NT]/ncs:config/ios:interface/ios:GigabitEthernet/ios:name";
}
}
}I searched a different show to associate a value on leaf, but show running devices device NAME config ios:cached-show is deprecated and it's not function.
Did anyone have the same problem?
thanks a lot
Maurizio