ConfD User Community

Adding "ordered-by user" to a standard yang


At this point, I added it to standard yang. If the standard yang changes, we might forget to add the statement into the standard yang. Is there a better way to do this without editing the standard yang?
So far I tried to do it with augmentation (unsuccessfully), I researched tailf_sort-order but it does not have “user” option.
Please help!


See the YANG 1.1 RFC 7950:
5.6.3. Deviations
7.20.3. The “deviation” Statement


Thanks for a quick reply!
I tried adding this to an existing deviation definition:

deviation /if:interfaces/if:interface {
deviate add {
ordered-by user;
//other stuff following

During compilation I get:

error: unexpected keyword ‘ordered-by’

Our confd version is vsn: 6.4.3


I did some more research and the ordered-by is not a supported deviation statement:

    deviation “/path/to/deviation/target” {
     description “description text”;
     reference “reference text”;
     deviate not-supported; // option 1
     deviate operation { // option 2, 1 or more
     units “units name”;
     must “xpath-expr”; // 0 or more
     unique “unique-leafs”; // 0 or more
     default “default value”; // 0 or more ┼


Correct, sorry for the misleading pointer. However, the text in the RFC on deviations give you some guidance. For example:

…Deviations define the way a server or class of servers deviate from a standard. This means that deviations MUST never be part of a published standard, since they are the mechanism for learning how implementations vary from the standards…

So if you change a published standard YANG model you are going to make your customers unhappy. If you need to edit a standard YANG model in the way you suggest, you need to create your own proprietary model. It can be a copy of the standard one with your “ordered-by user” change that you then preferably give a different YANG model name and namespace to show that this is not a standard YANG model, rather your own proprietary one “inspired” by the standard YANG model