Subject: [netmod] Augmentation of mandatory nodes issue

From: "Peter Kajsa -X (pkajsa - PANTHEON TECHNOLOGIES at Cisco)" <[email-masked]>
Date: Mon, 29 Feb 2016 15:46:06 +0000

Hi everybody,

we have encountered the following issue:

augment "/other:module" {
   container foo {
       presence "some reason";
       leaf bar {
           mandatory true;
       }
   }
}

We assume the augment is incorrect due to mandatory leaf "bar" and target node in another module. Is it right ?
... and alternative writing of the same:

augment "/other:module" {
   container foo {
presence "some reason";
   }
}

augment "/other:module/foo" {
   leaf bar {
       mandatatory true;
   }
}

We still assume the second augment is incorrect due to mandatory leaf "bar" and target node in another module, but there are also beliefs it should be correct due to the target node "foo" is from the same module.

Thank you for help.

Best Regards
Peter

[http://www.cisco.com/web/europe/images/email/signature/logo05.jpg]

Peter Kajsa
Engineer - Software
[email-masked]
Phone:

Cisco Systems Limited

SK
Cisco.com<http://www.cisco.com>

[Think before you print.]Think before you print.

This email may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html

---

From: Robert Wilton <[email-masked]>
Date: Mon, 29 Feb 2016 17:00:20 +0000

Hi Peter,

Peter Verthez has already asked this same question earlier today. Please 
see attached responses (from Lada and myself) to see if they answer 
your/Peter V's query.

Thanks,
Rob

On 29/02/2016 15:46, Peter Kajsa -X (pkajsa - PANTHEON TECHNOLOGIES at 
Cisco) wrote:
> We assume the augment is incorrect due to mandatory leaf „bar“ and 
> target node in another module. Is it right ?
>
> We still assume the second augment is incorrect due to mandatory leaf 
> „bar“ and target node in another module, but there are also beliefs it 
> should be correct due to the target node „foo“ is from the same module.
>
> Thank you for help.
>
> Best Regards
>
> Peter
>
> http://www.cisco.com/web/europe/images/email/signature/logo05.jpg
>
> *Peter Kajsa*
> Engineer - Software
> [email-masked]
> Phone:
>
> 	
>
> *Cisco Systems Limited*
>
>
>
>
> SK
> Cisco.com <http://www.cisco.com>
>
> 	
>
>
> Think before you print.Think before you print.
>
> This email may contain confidential and privileged material for the 
> sole use of the intended recipient. Any review, use, distribution or 
> disclosure by others is strictly prohibited. If you are not the 
> intended recipient (or authorized to receive for the recipient), 
> please contact the sender by reply email and delete all copies of this 
> message.
>
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

Subject: Re: [netmod] Augment issue
From: Robert Wilton <[email-masked]>
To: Peter Verthez <[email-masked]>
Cc: [email-masked]
Date: Mon, 29 Feb 2016 15:33:36 +0000
List-Id: NETMOD WG list <netmod.ietf.org>

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:
> 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.
>
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
> .
>

_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod
.

Subject: Re: [netmod] Augment issue
From: Ladislav Lhotka <[email-masked]>
To: Peter Verthez <[email-masked]>
Cc: [email-masked]
Date: Mon, 29 Feb 2016 17:36:15 +0100
List-Id: NETMOD WG list <netmod.ietf.org>

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:
> 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.
> 
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

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

_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod
.