It means if the model has a node such as:
leaf some-feature { when "../type = 'ipv4' or ../type = 'ipv6'"; type int32; } and a certain device doesn't supports this on IPv6, it is not possible for a deviation to change the condition to "../type = 'ipv4'" Is that intentional? It seems more like an omission to me. ________________________________ From: Andy Bierman <a...@yumaworks.com> Sent: Thursday, 18 October 2018 10:54 a.m. To: Alex Campbell Cc: Michael Rehder; netmod@ietf.org Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object On Wed, Oct 17, 2018 at 2:43 PM, Alex Campbell <alex.campb...@aviatnet.com<mailto:alex.campb...@aviatnet.com>> wrote: > At the abstract level I do not understand how when-stmt would work > differently. > IMO deviation-stmt already allows enough flexibility to rewrite the model to > fit the implementation. FWIW: deviation statements cannot be used to modify when statements - "when" is missing from the list of statements that can be added/removed/replaced.. I'm wondering if this should be considered errata. This was intentional. I meant that deviations can already be used to add/replace/remove constraints within data nodes. It is true that there is no way to say certain constraints only apply based on external data. As Robert said, I don't understand why we need that. Andy ________________________________ From: netmod <netmod-boun...@ietf.org<mailto:netmod-boun...@ietf.org>> on behalf of Andy Bierman <a...@yumaworks.com<mailto:a...@yumaworks.com>> Sent: Thursday, 18 October 2018 7:21 a.m. To: Michael Rehder Cc: netmod@ietf.org<mailto:netmod@ietf.org> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't ensure presence of the mandatory object On Wed, Oct 17, 2018 at 10:56 AM, Michael Rehder <michael.reh...@amdocs.com<mailto:michael.reh...@amdocs.com>> wrote: That's exactly my point - I think that the wording is unclear in the RFC, that "conditional" doesn't necessarily mean the mandatory status is ignored. BTW a Schematron rule is emitted to ensure a "mandatory true" CHOICE has at least one CASE present, so there already is an "existential" check built. I'll suggest a YANG enhancement on "yang-next" for the ability to respect mandatory status or not by a when statement. The when statement works as intended. The entire subtree is on or off if when-stmt is present. There is a lot of relevant text in 7950 and it cannot be grouped into 1 section, so that may make it more complicated. The whole point of "augment when" and "uses when" is to allow the designer to say "this part of the model is only relevant for a subset of all possible values in another part of the model". In SNMP we called this SPARSE AUGMENTS but it was just DESCRIPTION clause text, not machine-reaable. At the abstract level I do not understand how when-stmt would work differently. IMO deviation-stmt already allows enough flexibility to rewrite the model to fit the implementation. Thanks mike Andy > -----Original Message----- > From: Ladislav Lhotka [mailto:lho...@nic.cz<mailto:lho...@nic.cz>] > Sent: Wednesday, October 17, 2018 4:43 AM > To: Michael Rehder <michael.reh...@amdocs.com>; Juergen Schoenwaelder > <j.schoenwael...@jacobs-university.de<mailto:j.schoenwael...@jacobs-university.de>> > Cc: netmod@ietf.org<mailto:netmod@ietf.org> > Subject: Re: [netmod] WHEN statement within mandatory objects doesn't > ensure presence of the mandatory object > > Michael Rehder <michael.reh...@amdocs.com> writes: > > > I've read rfc6110 and I didn't see any mention of "WHEN" on the > > mandatory status (section 9.1.1 Optional and Mandatory Nodes doesn't > > list it which seems a bit odd to me). > > RFC 6110 was being prepared along with RFC 6020, and section 9.1.1 is closely > related to sec. 3.1 in 6020. > > > The section on "WHEN" just mentions the xpath mapping, not anything > > about changing the mandatory status of the enclosing node. > > If you take into account the DSDL validation procedure (Figure 2 in RFC > 6110) then everything is IMO clear: > > - Mandatory nodes (as defined in sec. 9.1.1) are not wrapped in > <rng:optional> and thus are required during RELAX NG schema > validation, no matter what any "when" expression says. > > - Section 12.17 explains how when expressions are mapped to Schematron > asserts. This means that if an instance node exists in the data and a > when expression attached to the corresponding data node in YANG > evaluates to false, Schematron will report a failed assert.. > > - Note that Schematron cannot by definition report absence of an > instance based on the when expression attached to its data > node: Schematron rules are only fired for elements that are present in > the instance document. > > > > > I still think that the YANG RFC wording of "conditional" needs to indicate > > if the > node is mandatory status is affected or not. > > Note that rfc6060 "3.1 Mandatory Nodes" doesn't mention "WHEN" (it > > does mention presence). > > Perhaps this thread is just about misunderstanding of what "when" really > means, which is: Instances for which the "when" expression evaluates to false > must not be present. > > It does NOT mean that instances for which the "when" expression evaluates to > true must be present. > > Lada > > > > > Thanks > > Mike > >> -----Original Message----- > >> From: Juergen Schoenwaelder > >> [mailto:j.schoenwael...@jacobs-university.de<mailto:j.schoenwael...@jacobs-university.de>] > >> Sent: Saturday, October 13, 2018 5:20 PM > >> To: Michael Rehder <michael.reh...@amdocs.com> > >> Cc: netmod@ietf.org<mailto:netmod@ietf.org> > >> Subject: Re: [netmod] WHEN statement within mandatory objects doesn't > >> ensure presence of the mandatory object > >> > >> On Fri, Oct 12, 2018 at 04:08:48PM +0000, Michael Rehder wrote: > >> > >> > The mandatory statement in that case is ignored (I've pointed out > >> > the RNG and Schematron lack of enforcement). WHEN trumps the > >> > mandatory status (via explicit mandatory or implicit mandatory via > >> > min-elements > >> > 1) > >> > >> Has the RNG and Schematron been obtained following RFC 6110? If so, > >> this may be a problem with RFC 6110 but not with YANG itself. There > >> are validators that do not use RNG or Schematron. > >> > >> /js > >> > >> -- > >> Juergen Schoenwaelder Jacobs University Bremen gGmbH > >> Phone: +49 421 200 3587 Campus Ring 1 | 28759 Bremen | > >> Germany<https://maps.google.com/?q=Campus+Ring+1+%7C+28759+Bremen+%7C+Germany&entry=gmail&source=g> > >> Fax: +49 421 200 3103 <https://www.jacobs-university.de/> > > "Amdocs' email platform is based on a third-party, worldwide, cloud-based > system. Any emails sent to Amdocs will be processed and stored using such > system and are accessible by third party providers of such system on a limited > basis. Your sending of emails to Amdocs evidences your consent to the use of > such system and such processing, storing and access". > > _______________________________________________ > > netmod mailing list > > netmod@ietf.org<mailto:netmod@ietf.org> > > https://www.ietf.org/mailman/listinfo/netmod > > -- > Ladislav Lhotka > Head, CZ.NIC Labs > PGP Key ID: 0xB8F92B08A9F76C67 "Amdocs' email platform is based on a third-party, worldwide, cloud-based system. Any emails sent to Amdocs will be processed and stored using such system and are accessible by third party providers of such system on a limited basis. Your sending of emails to Amdocs evidences your consent to the use of such system and such processing, storing and access". _______________________________________________ netmod mailing list netmod@ietf.org<mailto:netmod@ietf.org> https://www.ietf.org/mailman/listinfo/netmod
_______________________________________________ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod