Hi all,
this is the 1st time I have to make some changes in a yang file
The “must” statement in file1 below was already in place , I simply removed from the bottom end some of the checks (specifically there was the “gbytes” units included). This is a change that I did not expect to break an otherwise working compilation. The remaining checks make sure the queue-limit’s value is always larger than the queue-min-limit’s value, irrespective of the units involved.
So I have the main yang file along with some annotations in a 2nd file.
file1.yang
container queue-limit {
...
must "(((../../queue-min-limit/units = 'bytes') and " +
" (((../units = 'bytes') and (../value >= ../../queue-min-limit//value)) or " +
" ((../units = 'kbytes') and ((../value * 1000) >= (../../queue-min-limit/value))) or " +
" ((../units = 'mbytes') and ((../value * 1000000) >= (../../queue-min-limit/value))))) or " +
" ((../../queue-min-limit/units = 'kbytes') and " +
" (((../units = 'bytes') and (../value >= (../../queue-min-limit/value * 1000))) or " +
" ((../units = 'kbytes') and (../value >= ../../queue-min-limit/value)) or " +
" ((../units = 'mbytes') and ((../value * 1000) >= ../../queue-min-limit/value)))) or " +
" ((../../queue-min-limit/units = 'mbytes') and " +
" (((../units = 'bytes') or " +
" ((../units = 'kbytes') and (../value >= (../../queue-min-limit/value * 1000))) or " +
" ((../units = 'mbytes') and (../value >= ../../queue-min-limit/value))))))"
{
error-message "Static queue limit cannot be configured to a smaller value than the minimum static queue size.";
}
...
}
some tailf:depencies are in the annotations yang file.
file1-ann.yang
tailf:annotate-statement container[name='queue-limit'] {
...
tailf:annotate-statement "must[name=\"" +
"(((../../queue-min-limit/units = 'bytes') and " +
" (((../units = 'bytes') and (../value >= ../../queue-min-limit//value)) or " +
" ((../units = 'kbytes') and ((../value * 1000) >= (../../queue-min-limit/value))) or " +
" ((../units = 'mbytes') and ((../value * 1000000) >= (../../queue-min-limit/value))))) or " +
" ((../../queue-min-limit/units = 'kbytes') and " +
" (((../units = 'bytes') and (../value >= (../../queue-min-limit/value * 1000))) or " +
" ((../units = 'kbytes') and (../value >= ../../queue-min-limit/value)) or " +
" ((../units = 'mbytes') and ((../value * 1000) >= ../../queue-min-limit/value)))) or " +
" ((../../queue-min-limit/units = 'mbytes') and " +
" (((../units = 'bytes') or " +
" ((../units = 'kbytes') and (../value >= (../../queue-min-limit/value * 1000))) or " +
" ((../units = 'mbytes') and (../value >= ../../queue-min-limit/value)))))) " +
"\"]"
{
tailf:dependency "/something";
tailf:dependency "/smth-else";
tailf:dependency "/yet-another";
}
...
}
I try to compile this to using the following command
confdc \
[........... tailf-common are included here among with other things..........] \
-c --verbose -o output/confd_yang/file1.fxs \
-a file1_ann.yang \
file1.yang
and the output I get
Generating .fxs file "output/confd_yang/file1.fxs"
Read file file1.yang
Read file file1-ann.yang
file1.yang:1278: warning: The 'must' expression should have a tailf:dependency. If is doesn't, it will be checked for every commit.
file1.yang:1278: warning: The 'must' expression should have a tailf:dependency. If is doesn't, it will be checked for every commit.
file1.yang:1278: warning: The 'must' expression should have a tailf:dependency. If is doesn't, it will be checked for every commit.
file1-ann.yang:469: error: No must statements with the given argument is found.
The annotate-statement seems the same (to me) as the “must” statement it refers to in file1.yang. I checked the lines side by side in a diff editor such as “meld”. So I expected the compilation to succeed. Yet I get the error that you see in the last line.
What am I missing ?
Thank you in advance for your help!