Subject: [netmod] PYANG refine fault ?

From: Balázs Lengyel <[email-masked]>
Date: Wed, 9 Oct 2019 15:01:43 +0000

Hello,

I was trying to validate the attached model. However pyang keeps complaining
about refining a default for a leaf-list:

[email-masked]:184: error: "leaf-list" node
"ietf-notification-capabilities::supported-excluded-change-type" cannot be
refined with "default"

Why? According to https://tools.ietf.org/html/rfc7950#section-7.13.2 “A
leaf-list node may get a set of default values ...” 

.

Confdc accepts this. Could this be a bug in pyang ?

Regards Balazs

-- 

Balazs Lengyel                    Senior Specialist
Ericsson Hungary Ltd. 

Mobile: +36-70-330-7909              email: [email-masked]

---

From: Mahesh Jethanandani <[email-masked]>
Date: Wed, 9 Oct 2019 14:13:55 -0700

Hi Balasz,

In general support of unions is poor across the tool sets that I have used. It does not help that yanglint gives a completely different error.

I did try yanger, and that did not result in an error.

The other option is to move the default statement inside the grouping, which seems to make the error go away.

Cheers.

> On Oct 9, 2019, at 8:01 AM, Balázs Lengyel <balazs.lengyel=[email-masked]> wrote:
> 
> Hello,
> I was trying to validate the attached model. However pyang keeps complaining about refining a default for a leaf-list:
>  
> [email-masked] <mailto:[email-masked]>:184: error: "leaf-list" node "ietf-notification-capabilities::supported-excluded-change-type" cannot be refined with "default"
>  
> Why? According to https://tools.ietf.org/html/rfc7950#section-7.13.2 <https://tools.ietf.org/html/rfc7950#section-7.13.2> “A leaf-list node may get a set of default values ...” 
> .
> Balazs Lengyel                    Senior Specialist                       Ericsson Hungary Ltd. 
> Mobile: +36-70-330-7909              email: [email-masked] <mailto:[email-masked]>
>  
> <[email-masked]>_______________________________________________
> netmod mailing list
> [email-masked] <mailto:[email-masked]>
> https://www.ietf.org/mailman/listinfo/netmod <https://www.ietf.org/mailman/listinfo/netmod>
Mahesh Jethanandani
[email-masked]

---

From: Andy Bierman <[email-masked]>
Date: Wed, 9 Oct 2019 14:29:51 -0700

Hi,

The YANG looks valid.
yangdump-pro reports 1 warning:

Warning: Revision date in the future (2019-10-10)
[email-masked]:90.3: warning(1021):
revision date in the future

*** /home/andy/Desktop/[email-masked]
*** 0 Errors, 1 Warnings

Andy

On Wed, Oct 9, 2019 at 2:14 PM Mahesh Jethanandani <[email-masked]>
wrote:

> Hi Balasz,
>
> In general support of unions is poor across the tool sets that I have
> used. It does not help that yanglint gives a completely different error.
>
> On Oct 9, 2019, at 8:01 AM, Balázs Lengyel <
> balazs.lengyel=[email-masked]> wrote:
>
> Hello,
> I was trying to validate the attached model. However pyang keeps
> complaining about refining a default for a leaf-list:
>
> [email-masked]:184: error: "leaf-list"
> node "ietf-notification-capabilities::supported-excluded-change-type"
> cannot be refined with "default"
>
>
> Why? According to https://tools.ietf.org/html/rfc7950#section-7.13.2 “A leaf-list node may get a set of default values ...”
>
> .
> <[email-masked]>
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
>
>
> Mahesh Jethanandani
> [email-masked]
>
>
>
> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod
>

---

From: Michal Vaško <[email-masked]>
Date: Thu, 10 Oct 2019 08:59:29 +0200

Hi,

yanglint actually validates the module just fine (at least the latest version) once the grammar errors are fixed. Namely, the spaces before ";" on lines 191 and 199 are removed.

Regards,
Michal

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 10 Oct 2019 10:02:02 +0200 (CEST)

Hi,

Balázs Lengyel <balazs.lengyel=[email-masked]> wrote:
> Why? According to https://tools.ietf.org/html/rfc7950#section-7.13.2 A
> leaf-list node may get a set of default values ... 
> 
> ..
> 

Yes, now fixed.

/martin

---

From: Martin Bjorklund <[email-masked]>
Date: Thu, 10 Oct 2019 10:02:48 +0200 (CEST)

Michal Vaško <[email-masked]> wrote:
> Hi,
> 
> yanglint actually validates the module just fine (at least the latest
> version) once the grammar errors are fixed. Namely, the spaces before
> ";" on lines 191 and 199 are removed.

These are not errors.  You are allowed to have any number of
whitespace (and comments) before the ';'.

/martin

> > > On Oct 9, 2019, at 8:01 AM, Balázs Lengyel
> > > <balazs.lengyel=[email-masked]> wrote:
> > > 
> > > Hello,
> > > [email-masked]
> > > <mailto:[email-masked]>:184: error:
> > > "leaf-list" node
> > > "ietf-notification-capabilities::supported-excluded-change-type"
> > > Why? According to https://tools.ietf.org/html/rfc7950#section-7.13.2
> > > <https://tools.ietf.org/html/rfc7950#section-7.13.2> “A leaf-list node
> > > may get a set of default values ...”
> > > .
> > > <mailto:[email-masked]>
> > >  
> > > <https://www.ietf.org/mailman/listinfo/netmod>
> > Mahesh Jethanandani
> > [email-masked]
> > 
> > 
> > 
>  
>  
>