Thanks Michal for the clarification

We have discussed this issue among the co-authors of 
draft-ietf-ccamp-flexigrid-yang and we are not sure about how to address a WG 
LC comment we have received on this topic

While the YANG code using the ancestor instead of relative paths looks easier 
to read and understand to an human code writer/reader, we are concerned about 
whether it is worthwhile standardizing in IETF a YANG data model which fails 
compilation with yanglint

The YANG code is correct (at least it passes pyang validation) but it fails 
yanglint validation just because yanglint does not support axes, so we expect 
that as soon as we upload the updated draft, the IETF datatracker will signal 
yang validation errors

Is there any guideline/suggestion from Netmod WG and YANG doctors on how to 
deal with such a case?

Thanks, Italo (on behalf of co-authors)

> -----Original Message-----
> From: Michal Vaško [mailto:[email protected]]
> Sent: martedì 18 gennaio 2022 08:07
> To: Italo Busi <[email protected]>
> Cc: Ladislav Lhotka <[email protected]>; Martin Björklund
> <[email protected]>; [email protected]
> Subject: Re: [netmod] YANG 'when' with absolute path
> 
> Hi,
> 
> yanglint uses its own XPath implementation, which unfortunately does not
> support axes, hence the error.
> 
> Regards,
> Michal
> 
> On Monday, January 17, 2022 16:59 CET, Italo Busi
> <[email protected]> wrote:
> 
> > Lada, Martin,
> >
> > Thanks for your suggestion and thanks Tom for having raised this issue
> > to Netmod WG
> >
> > We have tried to follow your suggestion and replaced the relative paths 
> > with:
> >       when "ancestor::nw:network/nw:network-types/tet:te-topology"
> >
> > You can find the updated YANG module on github:
> >
> > https://github.com/ietf-ccamp-wg/draft-ietf-ccamp-flexigrid-yang/tree/
> > wg-lc-resolution
> >
> > However, we have found some issues when compiling the new code with
> yanglint. This is the error that we have got from the on-line YANG validator:
> >
> >       libyang err : Invalid character 'a'[1] of expression
> 'ancestor::nw:network/nw:network-types/tet:te-topology/flexgt:flexi-grid-
> topology'. (/ietf-flexi-grid-
> topology:{augment='/nw:networks/nw:network/nt:link/tet:te/tet:te-link-
> attributes/tet:underlay/tet:primary-path/tet:path-
> element/tet:type/tet:label/tet:label-hop/tet:te-label/tet:technology'})
> >       YANGLINT[E]: Processing schema module from
> /var/yang/tmp/yangvalidator/yangvalidator-v2-workdir-tNQJZOjI/ietf-flexi-
> grid-topology.yang failed.
> >
> > Is this an issue with yanglint or with the updated code?
> >
> > Pyang compilation does not return any error/warning
> >
> > Thanks in advance
> >
> > Aihua, Sergio and Italo
> >
> > > -----Original Message-----
> > > From: Ladislav Lhotka [mailto:[email protected]]
> > > Sent: domenica 2 gennaio 2022 10:58
> > > To: Martin Björklund <[email protected]>
> > > Cc: [email protected]; [email protected]
> > > Subject: Re: [netmod] YANG 'when' with absolute path
> > >
> > >
> > >
> > > On 02. 01. 22 10:43, Martin Björklund wrote:
> > > > Hi,
> > > >
> > > > Ladislav Lhotka <[email protected]<mailto:[email protected]>>
> wrote:
> > > >> Carsten Bormann <[email protected]<mailto:[email protected]>> writes:
> > > >>
> > > >>> On 2021-12-30, at 13:29, tom petch
> <[email protected]<mailto:[email protected]>> wrote:
> > > >>>>
> > > >>>>        when
> > > >>>> "../../../../../../nw:network-types/tet:te-topology/“
> > > >>>
> > > >>> I’m probably showing my ignorance about YANG again, but what is
> > > >>> the reason this is not phrased as
> > > >>>
> > > >>>        when "./ancestor::nw:network-types/tet:te-topology/“
> > > >>
> > > >> Yes, this would work, with a minor correction:
> > > >>
> > > >>      when "./ancestor::node()/nw:network-types/tet:te-topology"
> > > >>
> > > >> because 'nw:network-types' isn't an ancestor of the context node.
> > > >> Also, the initial './' isn't actually needed, hence
> > > >>
> > > >>      when "ancestor::node()/nw:network-types/tet:te-topology"
> > > >
> > > > Or the more direct:
> > > >
> > > >      when "ancestor::nw:network/nw:network-types/tet:te-topology"
> > >
> > > Right, this is the best option.
> > >
> > > >
> > > > This style works if we can guarantee that there will be exactly
> > > > one node "nw:network" among our ancestors.
> > > >
> > > > It is perhaps easier to get this style right w/o a YANG compiler
> > > > (which would detect if the number of ".." in the relative path is
> > > > wrong), but the relative path might be easier to understand for a
> > > > casual reader.
> > >
> > > +1
> > >
> > > Lada
> > >
> > > >
> > > >
> > > >
> > > > /martin
> > > >
> > > >
> > > >
> > > >>
> > > >> Lada
> > > >>
> > > >>>
> > > >>> ?
> > > >>>
> > > >>> Grüße, Carsten
> > > >>>
> > > >>> _______________________________________________
> > > >>> netmod mailing list
> > > >>> [email protected]<mailto:[email protected]>
> > > >>> https://www.ietf.org/mailman/listinfo/netmod
> > > >>
> > > >> --
> > > >> Ladislav Lhotka
> > > >> Head, CZ.NIC Labs
> > > >> PGP Key ID: 0xB8F92B08A9F76C67
> > > >>
> > > >> _______________________________________________
> > > >> netmod mailing list
> > > >> [email protected]<mailto:[email protected]>
> > > >> https://www.ietf.org/mailman/listinfo/netmod
> > >
> > > --
> > > Ladislav Lhotka
> > > Head, CZ.NIC Labs
> > > PGP Key ID: 0xB8F92B08A9F76C67
> > >
> >
> >
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to