Ladislav Lhotka <[email protected]> wrote:
>
> > On 23 Aug 2016, at 11:09, Martin Bjorklund <[email protected]> wrote:
> >
> > Vladimir Vassilev <[email protected]> wrote:
> >> On 08/23/2016 10:15 AM, Martin Bjorklund wrote:
> >>> They are evaluated. See Section 7.5.3:
> >>>
> >>> When a datastore is validated, all "must" constraints are
> >>> conceptually evaluated once for each node in the accessible tree (see
> >>> Section 6.4.1).
> >>>
> >>>
> >>> /martin
> >> Then we have the case I objected to and the example:
> >>
> >> YANG 1.0:
> >>
> >> augment "/if:interfaces/if:interface" {
> >> container inet {
> >> must "../name = 'me0'" {
> >
> > This should have been a 'when' expression, not 'must'. Alternatively,
>
> An interesting case would be if there is the "when" statement as you
> suggest, and then also one or more "must" statements. IMO, in this
> case the "when" statement needs to be evaluated first using the
> procedure of sec. 7.21.5, and if (and only if) the result is true,
> then the "must" statements are evaluated.
Exactly. This is no different from any other node w/ both 'when' and
'must' (or 'mandatory', or 'min-elements')
/martin
> Again, an NP-container is no
> different from a leaf with a default value.
>
> Lada
>
> > it should have been a P-container, since obviously the container has
> > some semantics. Or alternatively, the must expression should have
> > been on the address leaf, since this is what you really checked.
> >
> >
> >
> > /martin
> >
> >
> >> description
> >> "The inet container is only valid for the management
> >> ('me0')
> >> interface.";
> >> }
> >> leaf address {
> >> type inet:ip-prefix;
> >> }
> >> }
> >> }
> >>
> >> YANG 1.1 (replace "../name = 'me0'" with "../name='me0' or not
> >> (./address)" and process 95 unnecessary Xpath evaluations).
> >>
> >> I think this proves the argument that there will be more unnecessary
> >> Xpath processing. In addition it illustrates how a simple task
> >> requires ugly patch (the ".. or not (./address)" added to the must
> >> expression) just to ensure the expression does not fail in the default
> >> case where the interface is not named "me0" and the user has not even
> >> attempted to create empty /interfaces/interface/inet container in YANG
> >> 1.1.
> >>
> >> Vladimir
> >>
> >
> > _______________________________________________
> > netmod mailing list
> > [email protected]
> > https://www.ietf.org/mailman/listinfo/netmod
>
> --
> Ladislav Lhotka, CZ.NIC Labs
> PGP Key ID: E74E8C0C
>
>
>
>
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod