Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAILURE: pyang -f tree yang/vendor/cisco/xe/16111/ietf-ipv4-unicast-routing.yang #1363

Open
freedanzman opened this issue Jan 26, 2023 · 1 comment

Comments

@freedanzman
Copy link

ERRORS:

$ pwd
/c/CODE/repos/cisco-product-apis/restconf/yang/vendor/cisco/xe/16111
$ pyang -f tree ietf-ipv4-unicast-routing.yang
ietf-ipv4-unicast-routing.yang:104: error: node ietf-routing::routing-instance is not found
ietf-ipv4-unicast-routing.yang:149: error: node ietf-routing::fib-route is not found
ietf-ipv4-unicast-routing.yang:164: error: node ietf-routing::fib-route is not found
ietf-ipv4-unicast-routing.yang:180: error: node ietf-routing::fib-route is not found

ATTEMPTED DIAGNOSIS:

ietf-routing.yang line 5:

prefix "rt";

ietf-ipv4-unicast-routing.yang lines 7-9:

import ietf-routing {
prefix "rt";
}

ietf-ipv4-unicast-routing.yang lines 103-104:

augment "/rt:routing/rt:routing-instance/rt:routing-protocols/"
+ "rt:routing-protocol/rt:static-routes" {

The error seems to be saying that from the augment statement above, it cannot find "rt:routing-instance" under the "rt:routing" part of the model/tree in ietf-routing.yang.

ietf-routing.yang lines 500-526:

container routing {
description
"Configuration parameters for the routing subsystem.";
list routing-instance {
key "name";
description
"Configuration of a routing instance.";

And yet "list routing-instance" is right there on line 523, right under the parent routing container (typical).

So... yeah. No idea why this is broken.
I checked the syntax to make sure nothing was missing or misplaced in terms of {}s or ;s and that all seems legitimate to me.
No idea why it cannot find routing-instance in the hierarchy when it is clearly there.

Similar problem with fib-route on ietf-ipv4-unicast-routing.yang lines 149/164/180. I was able to find fib-route in ietf-routing.yang line 669.

I must not know enough. Please teach me YANG wizards.

Cheers.

@einarnn
Copy link
Member

einarnn commented Apr 11, 2023

IIRC, this is a defect in pyang. If you try yanglint instead:

❯ /opt/git-repos/libyang/build/yanglint -f tree ietf-ipv4-unicast-routing.yang
module: ietf-ipv4-unicast-routing

  augment /rt:routing/rt:routing-instance/rt:routing-protocols/rt:routing-protocol/rt:static-routes:
    +--rw ipv4
       +--rw route* [destination-prefix]
          +--rw destination-prefix    inet:ipv4-prefix
          +--rw description?          string
          +--rw next-hop
             +---u rt:next-hop-content
  augment /rt:fib-route/rt:input/rt:destination-address:
    +--rw address?   inet:ipv4-address
  augment /rt:fib-route/rt:output/rt:route:
    +--rw destination-prefix?   inet:ipv4-prefix
  augment /rt:fib-route/rt:output/rt:route/rt:next-hop/rt:next-hop-options/rt:simple-next-hop:
    +--rw next-hop-address?   inet:ipv4-address

Unfortunately I cannot recall if a defect was raised against pyang.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants