Hi,

 

We have a question on the usage of a must statement within a grouping.

 

Assume the following grouping

 

grouping a-group {

  list a-list {

    must "count(.) != 1" {

      description

        "This list must either be empty or have at least 2 elements";

    }

    key "entry";

    leaf entry {

      type uint16;

    }

    leaf another-entry {

      type uint32;

    }

  }

}

 

And used in another module

 

container a-container {

  uses a-group;

}

 

The uses actually results in a data-tree like below

 

  +--rw a-container

      +--rw a-list* [entry]

           +--rw entry           uint16

           +--rw another-entry   uint32

 

Does the usage of the grouping usage also result in the expected behavior
for the must statement when configuring /a-container/a-list?  The '.' in the
must statement in the grouping refers to 'a-list' so will that return 2 in
case we have configured 2 elements in /a-container/a-list or should we write
the must statement at the level of 'a-container' stating that "count(a-list)
!= 1" (as below)?

 

grouping a-group {

  list a-list {

    key "entry";

    leaf entry {

      type uint16;

    }

  }

}

 

And used in another module

 

container a-container {

  uses a-group;

  must "count(a-list) != 1" {

    description

      "This list must either be empty or have at least 2 elements";

  }

}

 

Best regards - Vriendelijke groeten,

Bart Bogaert

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to