Subject: [netmod] unique for non-existing leafs

From: Balazs Lengyel <[email-masked]>
Date: Tue, 6 Oct 2015 14:32:26 +0200

Hello,
How is the list's unique statement evaluated/enforced if some of the 
leafs specified in the unique statement don't exist in the data tree.

list mylist {
     unique att1;
     leaf att1 {}
}

att1 is not mandatory. Can I have two list entries where att1 does not 
exist?

What if when or choice is the reason why the leaf does not exist?

Is this described in the RFC?

regards Balazs

-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
Senior Specialist
ECN: 831 7320
Mobile: +36-70-330-7909              email: [email-masked]

---

From: Jernej Tuljak <[email-masked]>
Date: Tue, 6 Oct 2015 14:50:51 +0200

> Is this described in the RFC?

7.8.3.

    The "unique" constraint specifies that the combined values of all the
    leaf instances specified in the argument string, including leafs with
    default values, MUST be unique within all list entry instances in
    which all referenced leafs exist.  The constraint is enforced
    according to the rules in Section 8.

Note the "instances in which all referenced leafs exist".

Jernej