Subject: [Netconf] yang-data cannot encode a choice statement?

From: Kent Watsen <[email-masked]>
Date: Mon, 10 Jul 2017 17:57:35 +0000

The current zerotouch draft (-14) has yang-data structure 
"zerotouch-information" that contains a 'choice' statement
whereby each 'case' statement resolves to a single 'container'
statement.

But yumadump-pro had a validation error, which Andy justified
via the 'yang-data' description statement in RFC 8040:

 "This extension is ignored unless it appears as a top-level
  statement.  It MUST contain data definition statements
  that result in exactly one container data node definition.
  An instance of a YANG data template can thus be translated
  into an XML instance document, whose top-level element
  corresponds to the top-level container."

Technically, I think that my 'choice' statement satisfied
this description, but Martin said that he also modified `pyang`
to also flag this as an error, and now it seems that the easiest
thing to do is to split the existing yang-data structure into
two distinct yang-data structures.  

This email regards needing to make this change to the zerotouch
draft.

Interestingly, due to how yang-data structures are encoded,
this change has *no* impact on zerotouch-information instance
document encoding.

On the downside, it was very nice before to have the choice
statement, as it clearly indicated the polymorphic nature of 
the zerotouch-information artifact...as otherwise it would look
like two unrelated structures, with just draft text relating 
them to each other.

Thoughts?
Kent

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Mon, 10 Jul 2017 21:14:43 +0200

Hi,

as long as the choice resolves to only one container in all possible
cases, I do not see a reason to reject the choice.

/js

On Mon, Jul 10, 2017 at 05:57:35PM +0000, Kent Watsen wrote:
> _______________________________________________
> Netconf mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netconf

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>

---

From: Andy Bierman <[email-masked]>
Date: Mon, 10 Jul 2017 12:33:14 -0700

Hi,

IMO the text should be changed so it does not matter what data nodes are in
the
yang-data structure.  There should be a warning that multiple top-level
nodes
cannot be represented in a single XML instance document, but this should not
be a mandatory requirement. Maybe a SHOULD instead of a MUST.

Andy

---

From: Kent Watsen <[email-masked]>
Date: Sat, 15 Jul 2017 08:43:56 +0000

So, what is the resolution for the zerotouch draft?

Again, I think that the current model (a 'choice' that always resolves to a
'container') is allowed per RFC 8040, but `yangdump` and `pyang` don't
accept it.

I already factored the model into two separate rc:yang-data structures,
in my local copy, but I'll gladly discard it if it's okay to keep the original.

Thanks,
Kent

On 7/10/17, 9:33 PM, "Andy Bierman" <[email-masked]<mailto:[email-masked]>> wrote:

Hi,

IMO the text should be changed so it does not matter what data nodes are in the
yang-data structure.  There should be a warning that multiple top-level nodes
cannot be represented in a single XML instance document, but this should not
be a mandatory requirement. Maybe a SHOULD instead of a MUST.

Andy

On Mon, Jul 10, 2017 at 12:14 PM, Juergen Schoenwaelder <[email-masked]<mailto:[email-masked]>> wrote:
Hi,

/js

On Mon, Jul 10, 2017 at 05:57:35PM +0000, Kent Watsen wrote:
> [email-masked]<mailto:[email-masked]>

_______________________________________________
Netconf mailing list
[email-masked]<mailto:[email-masked]>
https://www.ietf.org/mailman/listinfo/netconf

---

From: Kent Watsen <[email-masked]>
Date: Wed, 26 Jul 2017 17:21:05 +0000

As a follow-up to this, I just noticed that the error has cleared on the YANG module validation page:

            http://www.claise.be/IETFYANGPageCompilation.html

Andy, did you change your code to allow a top-level choice statement?   Does this mean we can close this issue out as a no-op to the draft?

Kent // author

On 7/15/17, 4:43 AM, "Netconf on behalf of Kent Watsen" <[email-masked]<mailto:[email-masked]> on behalf of [email-masked]<mailto:[email-masked]>> wrote:

Thanks,
Kent

Hi,

Andy

/js

---

From: Andy Bierman <[email-masked]>
Date: Wed, 26 Jul 2017 10:27:49 -0700

On Wed, Jul 26, 2017 at 10:21 AM, Kent Watsen <[email-masked]> wrote:

> Andy, did you change your code to allow a top-level choice statement?
> Does this mean we can close this issue out as a no-op to the draft?
>
>
>

No -- did not change the code yet -- I might just remove the warning check.
I think the restriction is too arbitrary, especially since
there is no ability to define an augment for yang-data.  The assumption
that the data structure
MUST represent a valid XML instance document assumes it is a top-level
structure.

In fact these data structures are sometimes used within a parent element so
there is no need
to require the YANG node type to be a container.

Kent // author

Andy

>
>
> On 7/15/17, 4:43 AM, "Netconf on behalf of Kent Watsen" <
> [email-masked] on behalf of [email-masked]> wrote:
>
>
>
>
>
> On 7/10/17, 9:33 PM, "Andy Bierman" <[email-masked]> wrote:
>
>
>
> Hi,
>
>
>

---

From: Mahesh Jethanandani <[email-masked]>
Date: Wed, 26 Jul 2017 13:49:21 -0400

Note, that this addresses the issue discussed in the WG meeting and needed to be concluded on as part of the LC. At this point, the chairs believe the document is ready for publication. As I indicated on the other thread, we need explicit support for it to successfully conclude the LC. 

Thanks.

> On Jul 26, 2017, at 1:27 PM, Andy Bierman <[email-masked]> wrote:
> 
> 
> 
> On Wed, Jul 26, 2017 at 10:21 AM, Kent Watsen <[email-masked] <mailto:[email-masked]>> wrote:
>             http://www.claise.be/IETFYANGPageCompilation.html <http://www.claise.be/IETFYANGPageCompilation.html>
>  
> 
> there is no ability to define an augment for yang-data.  The assumption that the data structure
> MUST represent a valid XML instance document assumes it is a top-level structure.
> 
> In fact these data structures are sometimes used within a parent element so there is no need
> On 7/15/17, 4:43 AM, "Netconf on behalf of Kent Watsen" <[email-masked] <mailto:[email-masked]> on behalf of [email-masked] <mailto:[email-masked]>> wrote:
> 
>  
> 
>  
> 
> On 7/10/17, 9:33 PM, "Andy Bierman" <[email-masked] <mailto:[email-masked]>> wrote:
> 
>  
> 
> Hi,
> 
>  
> 
> On Mon, Jul 10, 2017 at 12:14 PM, Juergen Schoenwaelder <[email-masked] <mailto:[email-masked]>> wrote:
> 
> Hi,
> 
> > [email-masked] <mailto:[email-masked]>
> > https://www.ietf.org/mailman/listinfo/netconf <https://www.ietf.org/mailman/listinfo/netconf>
> 
> --
> Fax:   +49 421 200 3103         <http://www.jacobs-university.de/ <http://www.jacobs-university.de/>>
> 
> [email-masked] <mailto:[email-masked]>
> https://www.ietf.org/mailman/listinfo/netconf <https://www.ietf.org/mailman/listinfo/netconf>
>  
> 
> 

Mahesh Jethanandani (as co-chair).
[email-masked]

---

From: Kent Watsen <[email-masked]>
Date: Wed, 26 Jul 2017 18:28:37 +0000

Hi Mahesh,

This was the major issue that might've triggered the need for another last call.  Thankfully it looks like we don't need to do that now.  Still, there are a number of editorial issues that should be addressed before progressing it to the IESG.  Is this what you meant?

Kent // draft author

On 7/26/17, 1:49 PM, "Mahesh Jethanandani" <[email-masked]<mailto:[email-masked]>> wrote:

Thanks.

On Jul 26, 2017, at 1:27 PM, Andy Bierman <[email-masked]<mailto:[email-masked]>> wrote:

On Wed, Jul 26, 2017 at 10:21 AM, Kent Watsen <[email-masked]<mailto:[email-masked]>> wrote:
As a follow-up to this, I just noticed that the error has cleared on the YANG module validation page:

Kent // author

Andy

Thanks,
Kent

Hi,

Andy

/js

Mahesh Jethanandani (as co-chair).
[email-masked]<mailto:[email-masked]>

---

From: Mahesh Jethanandani <[email-masked]>
Date: Wed, 26 Jul 2017 14:34:45 -0400

> On Jul 26, 2017, at 2:28 PM, Kent Watsen <[email-masked]> wrote:
> 
>  
> Hi Mahesh,
>  

Yes. We had agreed that the editorial issues would be addressed as part of the LC. Notice that the datatracker indicates a revised I-D is needed.

Stream	WG state <https://datatracker.ietf.org/help/state/draft/ietf>		In WG Last Call
Revised I-D Needed - Issue raised by WGLC

>  
> Kent // draft author
>  
>  
> On 7/26/17, 1:49 PM, "Mahesh Jethanandani" <[email-masked] <mailto:[email-masked]>> wrote:
>  
>> On Jul 26, 2017, at 1:27 PM, Andy Bierman <[email-masked] <mailto:[email-masked]>> wrote:
>>  
>>  
>>  
>>> On 7/15/17, 4:43 AM, "Netconf on behalf of Kent Watsen" <[email-masked] <mailto:[email-masked]> on behalf [email-masked] <mailto:[email-masked]>> wrote:
>>>  
>>>  
> [email-masked] <mailto:[email-masked]>
>  
>  
>  

Mahesh Jethanandani
[email-masked]