cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1457
Views
5
Helpful
2
Replies

tailff:dependency and enum issues

kerim mohammed
Level 3
Level 3

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

2 Replies 2

vleijon
Cisco Employee
Cisco Employee

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.

thanks...I was using "when" for the wrong purpose...may be I should play with "must"