10-31-2019 12:12 AM
NSO gives me error when I refine a leaf-list with multiple “default” statements . The code is:
grouping fruitSalad {
leaf name {
type string;
}
leaf-list fruit {
type enumeration {
enum pear;
enum banana;
enum apple;
enum orange;
}
}
}
...
container myPlate {
uses fruitSalad {
refine fruit {
default banana;
default pear;
}
}
}
NSO diagnostic:
[root@localhost src]# make
/opt/ncs/current/bin/ncsc `ls LF8-ann.yang > /dev/null 2>&1 && echo "-a LF8-ann.yang"` \
-c -o ../load-dir/LF8.fxs yang/LF8.yang
yang/LF8.yang:109: error: keyword 'default' already given
No error if I write multiple groupings in a leaf-list or if I put only one default in the “refine”
I read in RFC 7950 7.13.2: “The following refinements can be done:… A leaf-list node may get a set of default values … . Is that a bug of NSO? Is there a work-around?
Solved! Go to Solution.
10-31-2019 09:50 AM
yang/LF8.yang:109: error: keyword 'default' already given
I read in RFC 7950 7.13.2: “The following refinements can be done:… A leaf-list node may get a set of default values … . Is that a bug of NSO? Is there a work-around?
It sure seems like a bug. Please file a support ticket.
Thanks,
Ram
10-31-2019 09:50 AM
yang/LF8.yang:109: error: keyword 'default' already given
I read in RFC 7950 7.13.2: “The following refinements can be done:… A leaf-list node may get a set of default values … . Is that a bug of NSO? Is there a work-around?
It sure seems like a bug. Please file a support ticket.
Thanks,
Ram
08-01-2022 02:00 PM
RFC 6020 (YANG 1.0) does not include the default refinement for leaf-lists. Does NSO support YANG 1.1 (RFC 7950)?
08-02-2022 12:53 AM
I tried this in NSO version 5.8.2.1 and I did not see this error, and was able to load the model and see default values. NSO supports both 1.0 and 1.1. As per RFC7950 to get 1.1 behavior you have to use the statement 'yang-version 1.1;'', so please check you have that statement in your yang model and if it is there, then upgrade NSO to the newest version.
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