IETF-TEAS-WG / ietf-teas-yang-path-computation

0 stars 4 forks source link

YANG Catalog Compilation Errors #85

Closed italobusi closed 3 years ago

italobusi commented 3 years ago

FWIW, I used https://yangcatalog.org/yangvalidator/validator to compile ietf-te-path-computation (you'll have to upload 6 files in 1 shot)

I do see some errors (maybe tools issue) that may need your attention:

XYM Extraction No warnings or errors Pyang Validation No warnings or errors Pyang Output No warnings or errors Confdc Output ietf-te-path-computation.yang:615: error: the node 'path-compute-info' from module 'ietf-te' (in node 'tunnels-path-compute' from 'ietf-te') is not found ietf-te-path-computation.yang:684: error: the node 'path-compute-info' from module 'ietf-te' (in node 'tunnels-path-compute' from 'ietf-te') is not found ietf-te-path-computation.yang:727: error: the node 'path-compute-info' from module 'ietf-te' (in node 'tunnels-path-compute' from 'ietf-te') is not found ietf-te-path-computation.yang:783: error: the node 'path-compute-info' from module 'ietf-te' (in node 'tunnels-path-compute' from 'ietf-te') is not found ietf-te-path-computation.yang:866: error: the node 'path-compute-info' from module 'ietf-te' (in node 'tunnels-path-compute' from 'ietf-te') is not found ietf-te@2020-07-12.yang:276) is converted to 'string' when part of a union ietf-te@2020-07-12.yang:280) is converted to 'string' when part of a union ietf-te@2020-07-12.yang:443: error: the node 'te' from module 'ietf-te-path-computation' is not found ietf-te@2020-07-12.yang:980: error: the node 'tunnels' from module 'ietf-te-path-computation' (in node 'tunnels-path-compute' from 'ietf-te') is not found yanglint Validation err : No resolvents found for leafref "/te/globals/named-path-constraints/named-path-constraint/name". (/ietf-te:tunnels-path-compute/input/path-compute-info/ietf-te-path-computation:path-request/ietf-te-path-computation:named-path-constraint) err : No resolvents found for leafref "../../../../../../tunnels/tunnel/name". (/ietf-te:tunnels-path-compute/input/path-compute-info/ietf-te-path-computation:tunnel-attributes/ietf-te-path-computation:hierarchy/ietf-te-path-computation:dependency-tunnels/ietf-te-path-computation:dependency-tunnel/ietf-te-path-computation:name) err : Module "ietf-te-path-computation" parsing failed.

Originally posted by @tsaad-dev in https://github.com/tsaad-dev/te/issues/114#issuecomment-751874770

italobusi commented 3 years ago

err : No resolvents found for leafref "/te/globals/named-path-constraints/named-path-constraint/name". (/ietf-te:tunnels-path-compute/input/path-compute-info/ietf-te-path-computation:path-request/ietf-te-path-computation:named-path-constraint)

The namespaces in /ietf-te:tunnels-path-compute/input/path-compute-info/ietf-te-path-computation:path-request/ietf-te-path-computation:named-path-constraint are correct because PC RPC uses the path-compute-info grouping defined in ietf-te.

However, it is not clear is where the "/te/globals/named-path-constraints/named-path-constraint/name" leafref is defined since the named-path-constraint leaf in the path-compute-info grouping is defined as:

    leaf named-path-constraint {
      if-feature "te-types:named-path-constraints";
      type leafref {
        path "/te:te/te:globals/te:named-path-constraints/"
           + "te:named-path-constraint/te:name";
      }
      description
        "Reference to a globally defined named path constraint set.";
    }

err : No resolvents found for leafref "../../../../../../tunnels/tunnel/name". (/ietf-te:tunnels-path-compute/input/path-compute-info/ietf-te-path-computation:tunnel-attributes/ietf-te-path-computation:hierarchy/ietf-te-path-computation:dependency-tunnels/ietf-te-path-computation:dependency-tunnel/ietf-te-path-computation:name)

Similar issue here: the namespaces in /ietf-te:tunnels-path-compute/input/path-compute-info/ietf-te-path-computation:tunnel-attributes/ietf-te-path-computation:hierarchy/ietf-te-path-computation:dependency-tunnels/ietf-te-path-computation:dependency-tunnel/ietf-te-path-computation:name are correct because PC RPC uses the tunnel-hierarchy-properties grouping defined in ietf-te.

However, it is not clear is where the "../../../../../../tunnels/tunnel/name" leafref is defined since the name leaf in the tunnel-hierarchy-properties grouping is defined as:

          leaf name {
            type leafref {
              path "/te:te/te:tunnels/te:tunnel/te:name";
              require-instance false;
            }

This is consistent with the YANG tree produced by pyang:

  augment /te:tunnels-path-compute/te:input/te:path-compute-info:
    +-- tunnel-attributes* [tunnel-name]
    |  +-- tunnel-name               string
    |  +-- hierarchy
    |     +-- dependency-tunnels
    |     |  +-- dependency-tunnel* [name]
    |     |  |  +-- name              -> /te:te/tunnels/tunnel/name
    |     |  |  +-- encoding?         identityref
    |     |  |  +-- switching-type?   identityref

See: https://raw.githubusercontent.com/rvilalta/ietf-te-path-computation/yang-doctor/ietf-te-path-computation.tree

I am wondering whether the YANG catalog is using the latest version of the ietf-te YANG module in https://github.com/tsaad-dev/te/commit/98abcd2cc80d278667fe99a0307a4f94a2a6565c

italobusi commented 3 years ago

It seems that the YANG catalog validation is not using the latest version of the ietf-te YANG module in https://github.com/tsaad-dev/te/commit/98abcd2cc80d278667fe99a0307a4f94a2a6565c, even if that version is uploaded together with this module

Closed together with https://github.com/tsaad-dev/te/issues/114