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"
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