Subject: [netmod] Augment issue

From: Peter Verthez <[email-masked]>
Date: Mon, 29 Feb 2016 10:09:17 +0100

Hi all,

A few weeks ago I reported a bug on the OpenDaylight YANG parser, 
regarding a error that was generated on a particular augment 
construction.   The bug report is the following:
https://bugs.opendaylight.org/show_bug.cgi?id=5335

We are disagreeing on the interpretation of the YANG RFC regarding to 
this bug, so could we get the opinion of the people on this mailing list 
on it?

The problem originated from a proposed Broadband Forum model, but 
there's a dummy model that reproduces the problem attached to that bug 
report.

Thanks,
Peter.

---

From: Robert Wilton <[email-masked]>
Date: Mon, 29 Feb 2016 15:33:36 +0000

Hi Peter,

I agree with you, i.e. I think that this is a bug in the OpenDaylight 
YANG parser.

My interpretation is that augmentations with mandatory nodes within a 
module, or a sub-module on nodes in its parent module are allowed.

This augmentation from the jukebox-cd module onto an external module is 
allowed because it is not augmenting with a mandatory node:

     augment "/jbox:jukebox" {
        container cdcapable {
          presence
      "If present, indicates that the jukebox can play CDs";
        }
     }

This augmentation is allowed because it is from a sub-module to its 
parent module:

     augment "/jbox:jukebox/jboxcd:cdcapable" {
       description
       "Extra jukebox CD data";

       leaf number-of-cds {
         type uint16;
         mandatory true;
         description
         "The number of CDs in the jukebox";
       }
     }

Interestingly, this second augmentation wouldn't/shouldn't be allowed if 
the cdcapable container didn't have presence.  Which I think means that 
when a sub-module augmentation is being considered, it needs to 
determine what the combined augmentation on the external module is to 
determine whether the augmentation adds any unconditional mandatory 
nodes on the external module - which is not allowed.

Thanks,
Rob

On 29/02/2016 09:09, Peter Verthez wrote:
> this bug, so could we get the opinion of the people on this mailing 
> list on it?
>
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
> .
>

---

From: Ladislav Lhotka <[email-masked]>
Date: Mon, 29 Feb 2016 17:36:15 +0100

Hi Peter,

I agree it should be OK. I tried to reproduce the situation and test it with pyang and it led to a Python exception. So I filed an issue:

https://github.com/mbj4668/pyang/issues/206

Lada

> On 29 Feb 2016, at 10:09, Peter Verthez <[email-masked]> wrote:
> 
> Hi all,
> 
> A few weeks ago I reported a bug on the OpenDaylight YANG parser, regarding a error that was generated on a particular augment construction.   The bug report is the following:
> We are disagreeing on the interpretation of the YANG RFC regarding to this bug, so could we get the opinion of the people on this mailing list on it?
> 
> The problem originated from a proposed Broadband Forum model, but there's a dummy model that reproduces the problem attached to that bug report.
> 
> Thanks,
> Peter.
> 

--
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C