ConfD User Community

Refine the default value based on certain conditions


    grouping   testusers{
        leaf max-user {
            type uint8 {range "1..100";}
            default 100;

container Test {
   leaf  dummy {
    type enumeration {
       enum  xyz;
       enum abc;
  uses  testusers{
            refine max-user{
                default 10;
            when "../dummy = 'xyz' ";

The use of when as above will make the max-user leaf conditional however that’s not the requirement.
The requirement is that leaf max-user should always be present but its default value to have different values based on the value of the dummy leaf.

Thank you in advance.

You can perhaps use the tailf:default-ref extension to point to a hidden value that is set by a transaction-hook when the dummy leaf value is changed, See the “Default Values” chapter in the ConfD UG.

Thank you very much for replying.
Will give it a try.