Hi Mike,
On 16/10/2018 16:34, Michael Rehder wrote:
Ok, so it is there in the RFC, just somewhat separated (in my view)
from the definition of “when”.
I still am somewhat surprised by this implementation.
Far more often the I see a need to enforce the presence of a variant.
I'm sorry, but I still haven't seen you provide any concrete example in
YANG where this is useful.
Early in the thread you provided an example with static/dynamic IP
addresses, and wrote 'There is no way in the IPAddresses list to enforce
that there is at least one IP Address when the assignment method is
"Static".'. But as I replied previously, for YANG at least, this
statement is wrong since your YANG achieves exactly that constraint!
Specifically, if you have a server that implements the YANG module that
you provided and a client attempted to configure it via NETCONF or
RESTCONF then the server would enforce that either the assignment is
DHCP or at least one static IP address is provided, otherwise the config
change would be rejected.
I think that your issue may be more with how the YANG is translated via
the methods in RFC 6110 (which I am not familiar with), but that doesn't
mean that there is a problem with the YANG definition itself. Allowing
mandatory/min-elements/max-elements to have precedence over 'when'
doesn't make much sense to me, I'm missing a concrete example where it
seems that this would be useful, certainly your IP address example does
not require it.
Thanks,
Rob
Thanks
Mike
*From:*Robert Wilton [mailto:[email protected]]
*Sent:* Tuesday, October 16, 2018 9:42 AM
*To:* Michael Rehder <[email protected]>; Juergen
Schoenwaelder <[email protected]>
*Cc:* [email protected]
*Subject:* Re: [netmod] WHEN statement within mandatory objects
doesn't ensure presence of the mandatory object
Hi Mike,
On 16/10/2018 14:26, Michael Rehder wrote:
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).
The section on "WHEN" just mentions the xpath mapping, not anything about
changing the mandatory status of the enclosing node.
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).
By YANG RFC do you mean RFC 6020/7950?
Section 8.1 of RFC 7950 states the following constraints apply on
valid data trees:
o There MUST be no nodes tagged with "when" present if the "when"
condition evaluates to "false" in the data tree.
o The "mandatory" constraint is enforced for leafs and choices,
unless the node or any of its ancestors has a "when" condition or
"if-feature" expression that evaluates to "false".
o The "min-elements" and "max-elements" constraints are enforced for
lists and leaf-lists, unless the node or any of its ancestors has
a "when" condition or "if-feature" expression that evaluates to
"false".
These rules indicate that "when" trumps "mandatory", "min-elements" and
"max-elements".
Thanks,
Rob
Thanks
Mike
-----Original Message-----
From: Juergen Schoenwaelder
[mailto:[email protected]]
Sent: Saturday, October 13, 2018 5:20 PM
To: Michael Rehder<[email protected]>
<mailto:[email protected]>
Cc:[email protected] <mailto:[email protected]>
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
Fax: +49 421 200 3103<https://www.jacobs-university.de/>
<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
[email protected] <mailto:[email protected]>
https://www.ietf.org/mailman/listinfo/netmod
/“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
[email protected]
https://www.ietf.org/mailman/listinfo/netmod