03-03-2019 02:27 PM
Guys,
list device-role {
key "role";
tailf:cli-compact-syntax;
leaf role {
type enumeration {
enum spines;
enum leafs;
}
}
leaf-list device {
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
}
}
here is snippet of the model generating issue:
list leaf-sw {
key name;
leaf name {
when "deref(../../cz)/../device-role= 'leafs'" {
tailf:dependency "/dcrouting:us-datacenters/dc/l3cz-topology/device-role";
}
type leafref {
path "deref(../../cz)/../device-role/device";
}
}
}
here is the issue am seeing when compiling the yang model:
yang/dcrouting.yang:58: warning: Given dependencies are not equal to calculated: ../../../../device-role. Consider removing tailf:dependency statements.
yang/dcrouting.yang:72: warning: Given dependencies are not equal to calculated: ../../../../device-role. Consider removing tailf:dependency statements.
yang/dcrouting.yang:92: warning: Given dependencies are not equal to calculated: ../../../../device-role. Consider removing tailf:dependency statements.
yang/dcrouting.yang:106: warning: Given dependencies are not equal to calculated: ../../../../device-role. Consider removing tailf:dependency statements.
admin@NSO-SIM:~/ncs-run/packages/dcrouting/src$
please let me know how to make when statement work or what I am doing wrong.
thanks,
Kerim
03-04-2019 02:09 AM
Those are only warnings, so it will work anyhow.
But what it means is that your path differs from the calculated path. When NSO can automatically derive a dependency, you might as well remove your manual dependency.
03-04-2019 08:38 PM
thanks...I was using "when" for the wrong purpose...may be I should play with "must"
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: