Subject: [netconf] yanglint errors for ietf-subscribed-notifications

From: Mahesh Jethanandani <[email-masked]>
Date: Fri, 13 Mar 2020 13:14:11 -0700

As I mentioned in the other thread, I am seeing errors while trying to use yanglint to validate examples for modules that import ietf-subscribed-notifications. I see it with ietf-notification-capabilities and with my own draft ietf-https-notif. These errors do not appear with confd. 

Using ietf-notification-capabilites and the first example in the -12 version of the draft which I call examples-notification-capabilities-1.xml, and released models for ietf-yang-push and ietf-subscribed-notifications, I see two issues. The first one related to the statement 'required-instance’ in ietf-subscribed-notifications is discussed on the other thread, and I do not want to repeat it here. If I comment out the only instance of ‘required-instance’ in the module, I run into more errors:

bash-3.2$ yanglint -s -i -t auto -p /Volumes/External/git/iana/yang-parameters/ [email-masked] [email-masked] examples-notification-capabilities-1.xml 
err : The leafref leaf is config but refers to a non-config leaf. (/ietf-subscribed-notifications:subscriptions/subscription/target/stream/stream)
err : Invalid value "subscription-policy" of "uses". (/ietf-subscribed-notifications:subscriptions/subscription/subscription-policy)
err : Copying data from grouping failed. (/ietf-subscribed-notifications:subscriptions/subscription/subscription-policy)
err : Module "ietf-subscribed-notifications" parsing failed.
err : Importing "ietf-subscribed-notifications" module into "ietf-yang-push" failed.
err : Module "ietf-yang-push" parsing failed.
err : Importing "ietf-yang-push" module into "ietf-notification-capabilities" failed.
err : Module "ietf-notification-capabilities" parsing failed.

While pyang gives the following error:

bash-3.2$  pyang -f tree [email-masked] > [email-masked]
[email-masked]:381: error: the path for stream is config but refers to a non-config leaf "name" defined at [email-masked]:1046

Have other encountered this error? If we agree this is an error, is there a -bis to fix this?

Thanks.

Mahesh Jethanandani
[email-masked]

---

From: Balázs Lengyel <[email-masked]>
Date: Mon, 16 Mar 2020 07:50:37 +0000

IMO this is a problem with pyang/yanglint not the model. By the way for me pyang 2.2.1 does not indicate an error.

Line 381:(379) defines 

typedef stream-ref {

    type leafref {

      path "/sn:streams/sn:stream/sn:name";

This is just a type so it is unknown if it is config=false or true.

The only place stream-ref is used is line 591

          type stream-ref {

            require-instance false;

According to https://tools.ietf.org/html/rfc7950#section-9.9

If the referring node represents configuration data and the

   "require-instance" property (Section 9.9.3 <https://tools.ietf.org/html/rfc7950#section-9.9.3> ) is "true", the referred

   node MUST also represent configuration.

However as the require-instance is false, this should not be a problem.

Regards Balazs

P.S> As yanglint does not provide line numbers it is hard to judge what it exactly wants.

From: netconf <[email-masked]> On Behalf Of Mahesh Jethanandani
Sent: 2020. március 13., péntek 21:14
To: Netconf <[email-masked]>; [email-masked]
Subject: [netconf] yanglint errors for ietf-subscribed-notifications

bash-3.2$ yanglint -s -i -t auto -p /Volumes/External/git/iana/yang-parameters/ [email-masked] <mailto:[email-masked]>  [email-masked] <mailto:[email-masked]>  examples-notification-capabilities-1.xml 

bash-3.2$  pyang -f tree [email-masked] <mailto:[email-masked]>  > [email-masked] <mailto:[email-masked]> 

[email-masked] <mailto:[email-masked]> :381: error: the path for stream is config but refers to a non-config leaf "name" defined at [email-masked] <mailto:[email-masked]> :1046

Thanks.

Mahesh Jethanandani

[email-masked] <mailto:[email-masked]>