Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: [802.3_YANG] update- YANG module compilation issues



Hi Mahesh,

Thanks for this reply- below, are some some additional observation into the ieee802-dot1ab-lldp.yang deref() issue and assorted YANG compilers- suggested next steps are encouraged.

On Tue, Oct 30, 2018 at 9:21 PM Mahesh Jethanandani <mjethanandani@xxxxxxxxx> wrote:
Hi Mark,

On Oct 30, 2018, at 4:59 PM, Mark Ellison <mark@xxxxxxxxxxxxxxxxxxx> wrote:

 <snip/>
================

The ieee802-dot1ab-lldp.yang module is flagged during yanglint validation:
warn: Schema node "type" not found (deref(.)/../type) with context node "/ieee802-dot1ab-lldp:lldp/port/name".
warn: Schema node "type" not found (deref(.)/../type = 'iana-if-type:ethernetCsmacd' or deref(.)/../type) with context node "/ieee802-dot1ab-lldp:lldp/port/name".

If we could review the following change, which appears to resolve the validation warning.  However, I would like confirmation that the change will follow the intent of the model as designed.  FYI- I did not see any other yang module under <github>/Yangmodels/standard/ that uses the deref() function.

deref() is part of YANG 1.1 specification in RFC 7950. 


I was under the impression that yanglint supported RFC 7950, as the README.md on github states, "Current implementation covers YANG 1.0 (RFC 6020) as well as YANG 1.1 (RFC 7950).". 

The yangdump-pro tool also raises a warning related to deref(), as follows:

Validation results for ieee802-dot1ab-lldp.yang
Warning: Module 'iana-if-type' not used
ieee802-dot1ab-lldp.yang:14.3: warning(1015): import not used

So, there appears to be an issue with how yangdump-pro is handling deref() as well.

For pyang (v 1.7.5), I relied on a compilation report (http://www.claise.be/IEEEStandardYANGPageCompilation.html), with the warning:

ieee802-dot1ab-lldp.yang:14: warning: imported module iana-if-type not used
ieee802-dot1ab-lldp.yang:761: warning: Searching for "{}" in leaf or leaf-list statement "{}". Leaf or leaf-list statement does not contain any children

While composing this reply, I tried a local copy of pyang (also v 1.7.5) and was unable to recreate the above warning.  So, at least my local copy of pyang likes deref() and can see the use of the imported iana-if-type.

Trying confd-6.7 (via http://www.yangvalidator.com/validator), the following warning is raised:

ieee802-dot1ab-lldp.yang:760: warning: The 'must' _expression_ should have a tailf:dependency. If is doesn't, it will be checked for every commit.

So it also appears that deref() is not cleanly parsed by Confdc.


[ellison@c30 draft]$ diff ieee802-dot1ab-lldp.yang.ORIG ieee802-dot1ab-lldp-FIX.yang 
759,761c759,761
<         type if:interface-ref;
<         must "deref(.)/../type = 'ianaift:ethernetCsmacd'" 
<            + " or deref(.)/../type = 'ianaift:ieee8023adLag'" {
---
>        type if:interface-ref;
>        must "/if:interfaces/if:interface[if:name=current()]/if:type = 'ianaift:ethernetCsmacd'" 
>           + " or /if:interfaces/if:interface[if:name=current()]/if:type = 'ianaift:ieee8023adLag'" {


================
 <snip/>

I am happy to take next steps- is it reasonable to open a ticket with these YANG tools regarding current parsing behavior of deref()?

Regards,

Mark

To unsubscribe from the STDS-802-YANG list, click the following link: https://listserv.ieee.org/cgi-bin/wa?SUBED1=STDS-802-YANG&A=1