cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1426
Views
0
Helpful
3
Replies

ERROR refining leaf-list with "default"

Fantolino
Level 1
Level 1

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?

 

1 Accepted Solution

Accepted Solutions

ramkraja
Cisco Employee
Cisco Employee

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

View solution in original post

3 Replies 3

ramkraja
Cisco Employee
Cisco Employee

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

RFC 6020 (YANG 1.0) does not include the default refinement for leaf-lists. Does NSO support YANG 1.1 (RFC 7950)?

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.