tsaad-dev / te

IETF TE Tunnels YANG models
16 stars 19 forks source link

Validation errors in Path computation RPC #114

Closed italobusi closed 3 years ago

italobusi commented 3 years ago

The definition of the path-compute-info in ietf-te@2020-07-12.yang is causing YANG validation errors with yanglint

See https://github.com/rvilalta/ietf-te-path-computation/issues/83

o Validation

The module fails YANG validation, but that is really due to errors in ietf-te@2020-07-12.yang. Specifially, the leafref in the grouping "path-compute-info" must have prefixes in its path. Without prefixes, the path refers to nodes in the module that uses the grouping. (same for other groupings in that module).

tsaad-dev commented 3 years ago

This was fixed in the latest commit 5d156bf

tsaad-dev 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.

tsaad-dev commented 3 years ago

BTW, it seems you are dropping te:input from the leafref path.. PYANG is happy about it but confdc is NOT.

italobusi commented 3 years ago

BTW, it seems you are dropping te:input from the leafref path.. PYANG is happy about it but confdc is NOT.

This was discussed on Netmod WG mailing list (different version of pyang were having a different behavior) and it seems that the behavior of yanglint and of the latest versions of pyang is the correct one:

https://mailarchive.ietf.org/arch/msg/netmod/3_f4IIX5tt-a5yi-x_P0k2BEAPg/

tsaad-dev commented 3 years ago

To confirm that all grouping used by external modules do not have a relative leafref path.