mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
530 stars 343 forks source link

process not-supported cause compliation error #763

Open lllyfeng opened 2 years ago

lllyfeng commented 2 years ago

for example, there are 3 modules: module a contains /a/b/c path and module b augment a container d to /a/b module c use deviation to tail /a/b ( devation /a/b devaite not-supported ) if we valiate module c firstly, it will also validate module a (because c import a), so the path a/b will be tailored. and if we validte module b ,it will cause error (because the target node has been deleted)

mbj4668 commented 2 years ago

can you include the three modules you use, and the command that gives the error?

lllyfeng commented 2 years ago

Martin: I download Huawei yang from https://github.com/Huawei/yang/tree/master/network-router/8.20.10/ne8000-m8 And I try to compile all yang files of this dictionary, and so many errors are reported: I’m trying to modify the pyang’s code. But I’am afraid it will cause lots of modifications. And NSO’s yang complier has the same issue.:)

./yang\huawei-bras-cups-extension.yang:10 Warning: imported module "huawei-ifm" not used ./yang\huawei-bras-l2tp-access.yang:4201 Error: node huawei-bras-cu-controller::bras-cu-controller is not found ./yang\huawei-bras-l2tp-access.yang:4291 Error: node huawei-bras-cu-controller::bras-cu-controller is not found ./yang\huawei-bras-l2tp-access.yang:1934 Warning: node "huawei-bras-cu-controller::bras-cu-controller" is not found in module "huawei-bras-cu-controller" ./yang\huawei-bras-l2tp-access.yang:1942 Warning: node "huawei-bras-cu-controller::bras-cu-controller" is not found in module "huawei-bras-cu-controller" ./yang\huawei-bras-l2tp-access.yang:2548 Warning: node "huawei-bras-cu-controller::bras-cu-controller" is not found in module "huawei-bras-cu-controller" ./yang\huawei-bras-l2tp-access.yang:2811 Warning: node "huawei-bras-cu-controller::bras-cu-controller" is not found in module "huawei-bras-cu-controller" ./yang\huawei-bras-l2tp-access.yang:43 Warning: imported module "huawei-system" not used ./yang\huawei-bras-l2tp-access-deviations-NE8000M8M14.yang:76 Error: node huawei-bras-cu-controller::bras-cu-controller is not found ./yang\huawei-bras-l2tp-access-deviations-NE8000M8M14.yang:79 Error: node huawei-bras-cu-controller::bras-cu-controller is not found ./yang\huawei-bras-multicast.yang:567 Error: node huawei-bras-basic-access::bras is not found ./yang\huawei-bras-multicast-deviations-NE8000M8M14.yang:41 Error: node huawei-bras-basic-access::bras is not found ./yang\huawei-bras-multicast-deviations-NE8000M8M14.yang:8 Warning: imported module "huawei-bras-multicast" not used ./yang\huawei-bras-pppox-access.yang:3121 Error: node huawei-bras-cu-controller::bras-cu-controller is not found ./yang\huawei-bras-pppox-access.yang:3149 Error: node huawei-bras-cu-controller::bras-cu-controller is not found ./yang\huawei-bras-pppox-access-deviations-NE8000M8M14.yang:48 Error: node huawei-bras-cu-controller::bras-cu-controller is not found ./yang\huawei-bras-pppox-access-deviations-NE8000M8M14.yang:51 Error: node huawei-bras-cu-controller::bras-cu-controller is not found ./yang\huawei-bras-user-manage.yang:8778 Error: node huawei-bras-basic-access::bras is not found ./yang\huawei-bras-user-manage-deviations-NE8000M8M14.yang:87 Error: node huawei-bras-basic-access::bras is not found ./yang\huawei-bras-vas-deviations-NE8000M8M14.yang:44 Error: node huawei-bras-basic-access::bras is not found ./yang\huawei-dcn.yang:17 Warning: imported module "huawei-network-instance" not used ./yang\huawei-driver.yang:3193 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-driver.yang:1933 Error: "huawei-devm:lpu-boards" in the path for board-position at ./yang\huawei-driver.yang:1931 is not found ./yang\huawei-driver.yang:1947 Error: "huawei-devm:lpu-boards" in the path for board-position at ./yang\huawei-driver.yang:1945 is not found ./yang\huawei-driver.yang:1966 Error: "huawei-devm:sfu-boards" in the path for board-position at ./yang\huawei-driver.yang:1964 is not found ./yang\huawei-driver.yang:1980 Error: "huawei-devm:sfu-boards" in the path for board-position at ./yang\huawei-driver.yang:1978 is not found ./yang\huawei-driver.yang:2374 Error: "huawei-devm:lpu-boards" in the path for board-position at ./yang\huawei-driver.yang:2372 is not found ./yang\huawei-driver-deviations-NE8000M8M14.yang:288 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-pic.yang:7534 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-fim-devm.yang:73 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-fim-devm-deviations-NE8000M8M14.yang:37 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-fim-devm-deviations-NE8000M8M14.yang:40 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-fim-devm-deviations-NE8000M8M14.yang:43 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-fim-devm-deviations-NE8000M8M14.yang:8 Warning: imported module "huawei-fim-devm" not used ./yang\huawei-flowspec-forward.yang:398 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-flowspec-forward-deviations-NE8000M8M14.yang:37 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-flowspec-forward-deviations-NE8000M8M14.yang:8 Warning: imported module "huawei-flowspec-forward" not used ./yang\huawei-fwd-engine.yang:219 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-host-defend.yang:1279 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-host-defend-deviations-NE8000M8M14.yang:30 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-host-defend-deviations-NE8000M8M14.yang:7 Warning: imported module "huawei-host-defend" not used ./yang\huawei-l2-multicast-forward.yang:80 Error: "huawei-devm:lpu-boards" in the path for slot at ./yang\huawei-l2-multicast-forward.yang:78 is not found ./yang\huawei-l2protocol-fwd.yang:618 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-l2protocol-fwd-deviations-NE8000M8M14.yang:57 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-loadbalance.yang:477 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-loadbalance.yang:685 Error: node huawei-devm-vnf::devm-vnf is not found ./yang\huawei-loadbalance-deviations-NE8000M8M14.yang:84 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-loadbalance-deviations-NE8000M8M14.yang:87 Error: node huawei-devm-vnf::devm-vnf is not found ./yang\huawei-mac-fwd.yang:138 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-mac-fwd-deviations-NE8000M8M14.yang:41 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-mirror.yang:770 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-mirror-deviations-NE8000M8M14.yang:48 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-mpls-forward-devm.yang:122 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-mpls-forward-devm-deviations-NE8000M8M14.yang:41 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-multicast-forward.yang:1530 Error: "huawei-devm:lpu-boards" in the path for slot at ./yang\huawei-multicast-forward.yang:1528 is not found ./yang\huawei-netstream.yang:1188 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-netstream.yang:1214 Error: "huawei-devm:lpu-boards" in the path for dest-slot at ./yang\huawei-netstream.yang:1211 is not found ./yang\huawei-netstream.yang:1216 Warning: node "huawei-devm::position" is not found in "huawei-netstream::/devm:devm/devm:lpu-boards/devm:lpu-board" ./yang\huawei-netstream-deviations-NE8000M8M14.yang:66 Error: node huawei-devm::lpu-boards is not found ./yang\openconfig-bgp-policy.yang:1149 (at ./yang\openconfig-bgp-policy.yang:770) Warning: node "openconfig-bgp-policy::INLINE" is not found in "openconfig-bgp-policy::inline" ./yang\openconfig-bgp-policy.yang:1149 (at ./yang\openconfig-bgp-policy.yang:829) Warning: node "openconfig-bgp-policy::REFERENCE" is not found in "openconfig-bgp-policy::reference" ./yang\openconfig-bgp-policy.yang:1149 (at ./yang\openconfig-bgp-policy.yang:933) Warning: node "openconfig-bgp-policy::INLINE" is not found in "openconfig-bgp-policy::inline" ./yang\openconfig-bgp-policy.yang:1149 (at ./yang\openconfig-bgp-policy.yang:994) Warning: node "openconfig-bgp-policy::REFERENCE" is not found in "openconfig-bgp-policy::reference" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:223) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::network-instances" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:780) Warning: node "openconfig-network-instance::type" is not found in "openconfig-network-instance::network-instance" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:789) Warning: node "openconfig-network-instance::type" is not found in "openconfig-network-instance::network-instance" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:269) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::network-instances" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:287) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::network-instances" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:407) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::network-instances" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:625) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::network-instances" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:633) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::network-instances" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:697) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::protocols" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:708) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::protocols" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:719) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::protocols" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-ospfv2-lsdb.yang:2316) Warning: node "openconfig-network-instance::state" is not found in "openconfig-network-instance::lsa-types" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-ospfv2-lsdb.yang:2324) Warning: node "openconfig-network-instance::state" is not found in "openconfig-network-instance::lsa-types" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-ospfv2-lsdb.yang:2335) Warning: node "openconfig-network-instance::state" is not found in "openconfig-network-instance::lsa-types" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-ospfv2-lsdb.yang:2343) Warning: node "openconfig-network-instance::state" is not found in "openconfig-network-instance::lsa-types" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-ospfv2-lsdb.yang:2351) Warning: node "openconfig-network-instance::state" is not found in "openconfig-network-instance::lsa-types" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-ospfv2-lsdb.yang:2361) Warning: node "openconfig-network-instance::state" is not found in "openconfig-network-instance::lsa-types" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:730) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::protocols" ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:738) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::protocols" ./yang\openconfig-pim.yang:369 Error: "openconfig-acl:acl" in the path for ssm-ranges at ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-pim.yang:366) is not found ./yang\openconfig-pim.yang:369 Error: "openconfig-acl:acl" in the path for ssm-ranges at ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-pim.yang:366) is not found ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:749) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::protocols" ./yang\openconfig-igmp.yang:295 Error: "openconfig-acl:acl" in the path for ssm-ranges at ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-igmp.yang:292) is not found ./yang\openconfig-igmp.yang:295 Error: "openconfig-acl:acl" in the path for ssm-ranges at ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-igmp.yang:292) is not found ./yang\openconfig-network-instance.yang:1165 (at ./yang\openconfig-network-instance.yang:760) Warning: node "openconfig-network-instance::config" is not found in "openconfig-network-instance::protocols" ./yang\huawei-pbr.yang:223 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-pbr.yang:1328 Error: node huawei-devm-vnf::devm-vnf is not found ./yang\huawei-pbr-deviations-NE8000M8M14.yang:45 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-pbr-deviations-NE8000M8M14.yang:48 Error: node huawei-devm-vnf::devm-vnf is not found ./yang\huawei-pic-deviations-NE8000M8M14.yang:277 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-qos-board.yang:233 Error: node huawei-devm-vnf::devm-vnf is not found ./yang\huawei-qos-board.yang:830 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-qos-board.yang:1604 Error: "huawei-devm-vnf:devm-vnf" in the path for vnfc-name at ./yang\huawei-qos-board.yang:1602 is not found ./yang\huawei-qos-board.yang:1612 Error: "huawei-devm-vnf:devm-vnf" in the path for slot-id at ./yang\huawei-qos-board.yang:1610 is not found ./yang\huawei-qos-board-deviations-NE8000M8M14.yang:87 Error: node huawei-devm-vnf::devm-vnf is not found ./yang\huawei-qos-board-deviations-NE8000M8M14.yang:123 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-routing-nqa.yang:68 Error: node huawei-routing::unicast-route2s is not found ./yang\huawei-routing-nqa.yang:92 Error: node huawei-routing::unicast-route2s is not found ./yang\huawei-routing-nqa.yang:116 Error: node huawei-routing::unicast-route2s is not found ./yang\huawei-routing-nqa.yang:140 Error: node huawei-routing::unicast-route2s is not found ./yang\huawei-routing-nqa.yang:78 Warning: node "huawei-routing::permanent" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-interfaces/rt:nexthop-interface/rt:track-setting" ./yang\huawei-routing-nqa.yang:78 Error: the path has too many ".." ./yang\huawei-routing-nqa.yang:86 Warning: node "huawei-routing::permanent" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-interfaces/rt:nexthop-interface/rt:track-setting" ./yang\huawei-routing-nqa.yang:86 Error: the path has too many ".." ./yang\huawei-routing-nqa.yang:102 Warning: node "huawei-routing::permanent" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-interface-addresses/rt:nexthop-interface-address/rt:track-setting" ./yang\huawei-routing-nqa.yang:102 Error: the path has too many ".." ./yang\huawei-routing-nqa.yang:110 Warning: node "huawei-routing::permanent" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-interface-addresses/rt:nexthop-interface-address/rt:track-setting" ./yang\huawei-routing-nqa.yang:110 Error: the path has too many ".." ./yang\huawei-routing-nqa.yang:126 Warning: node "huawei-routing::inherit-cost" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-addresses/rt:nexthop-address/rt:track-setting" ./yang\huawei-routing-nqa.yang:126 Warning: node "huawei-routing::permanent" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-addresses/rt:nexthop-address/rt:track-setting" ./yang\huawei-routing-nqa.yang:126 Error: the path has too many ".." ./yang\huawei-routing-nqa.yang:134 Warning: node "huawei-routing::inherit-cost" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-addresses/rt:nexthop-address/rt:track-setting" ./yang\huawei-routing-nqa.yang:134 Warning: node "huawei-routing::permanent" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-addresses/rt:nexthop-address/rt:track-setting" ./yang\huawei-routing-nqa.yang:134 Error: the path has too many ".." ./yang\huawei-routing-nqa.yang:150 Warning: node "huawei-routing::inherit-cost" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-vrf-addresses/rt:nexthop-vrf-address/rt:track-setting" ./yang\huawei-routing-nqa.yang:150 Warning: node "huawei-routing::permanent" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-vrf-addresses/rt:nexthop-vrf-address/rt:track-setting" ./yang\huawei-routing-nqa.yang:150 Error: the path has too many ".." ./yang\huawei-routing-nqa.yang:158 Warning: node "huawei-routing::inherit-cost" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-vrf-addresses/rt:nexthop-vrf-address/rt:track-setting" ./yang\huawei-routing-nqa.yang:158 Warning: node "huawei-routing::permanent" is not found in "huawei-routing-nqa::/ni:network-instance/ni:instances/ni:instance/l3vpn:afs/l3vpn:af/rt:routing/rt:static-routing/rt:unicast-route2s/rt:unicast-route2/rt:nexthop-vrf-addresses/rt:nexthop-vrf-address/rt:track-setting" ./yang\huawei-routing-nqa.yang:158 Error: the path has too many ".." ./yang\huawei-soc.yang:1965 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-soc.yang:1975 Error: node huawei-devm-vnf::devm-vnf is not found ./yang\huawei-soc-deviations-NE8000M8M14.yang:553 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-soc-deviations-NE8000M8M14.yang:556 Error: node huawei-devm-vnf::devm-vnf is not found ./yang\huawei-trafficmng.yang:163 Error: "huawei-devm:lpu-boards" in the path for slot-id at ./yang\huawei-trafficmng.yang:161 is not found ./yang\huawei-trafficmng.yang:196 Error: "huawei-devm:lpu-boards" in the path for slot-id at ./yang\huawei-trafficmng.yang:194 is not found ./yang\huawei-unicast-forward.yang:344 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-unicast-forward.yang:801 Error: node huawei-devm-vnf::devm-vnf is not found ./yang\huawei-unicast-forward-deviations-NE8000M8M14.yang:63 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-unicast-forward-deviations-NE8000M8M14.yang:90 Error: node huawei-devm-vnf::devm-vnf is not found ./yang\huawei-unicast-fwd-srv6.yang:113 Error: "huawei-devm:lpu-boards" in the path for slot-id at ./yang\huawei-unicast-fwd-srv6.yang:111 is not found ./yang\huawei-y1731-statistics.yang:251 Error: node huawei-devm::lpu-boards is not found ./yang\huawei-y1731-statistics-deviations-NE8000M8M14.yang:47 Error: node huawei-devm::lpu-boards is not found

发件人: Martin Bjorklund @. 发送时间: 2021年10月15日 16:35 收件人: mbj4668/pyang @.> 抄送: Fengchong (frank) @.>; Author @.> 主题: Re: [mbj4668/pyang] process not-supported cause compliation error (#763)

can you include the three modules you use, and the command that gives the error?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mbj4668/pyang/issues/763#issuecomment-944108628, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZEQZOJLZKXP4AGDSC5NKDUG7RTBANCNFSM5GBMZWOA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mbj4668 commented 2 years ago

Did you try to simplify this with a shorter example? If not, are you sure that the modules are correct and that there's a bug in pyang?

lllyfeng commented 2 years ago

I suggest the validation phases can be divided to 3 main phases, static_validation, process_not_supported,and reference_validation. when a pyang context is validated, all modules will execute static_validation (only tag not-supported node,don't delete it )firstly, and then tailor all not-supported data nodes, finally execute the reference_validation for all yang modules.

lllyfeng commented 2 years ago

I have checked it, most of errors are caused by not-supported. I will simplify it.

lllyfeng commented 2 years ago

yang.zip martin: I have provide a small yang files set. please see attachment. It still has error. ./yang\huawei-pic.yang:55 Error: node huawei-devm::lpu-boards is not found

mbj4668 commented 2 years ago

it works fine for me. pyang huawei-pic.yang doesn't give any errors.

lllyfeng commented 2 years ago

please sort the files. complie huawei - devm or huawei-devm-deviations firstly.huawei-pic should be compiled at last.


冯冲 Feng Chong Mobile: +86-13776612983<tel:+86-13776612983> Email: @.**@.> 发件人:Martin Bjorklund @.> 收件人:mbj4668/pyang @.> 抄 送:Fengchong (frank) @.>;Author @.> 时 间:2021-10-15 17:36:25 主 题:Re: [mbj4668/pyang] process not-supported cause compliation error (#763)

it works fine for me. pyang huawei-pic.yang doesn't give any errors.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mbj4668/pyang/issues/763#issuecomment-944149322, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZEQZMDPXAE5XY3YAA52BDUG7YZNANCNFSM5GBMZWOA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mbj4668 commented 2 years ago

can you send me the pyang command that fails with an error?

lllyfeng commented 2 years ago

I write a code to compile the whole directory yang files. the code will list all yang files,and I create a pyang context and call CTX.add_module for every yang file, at last I call CTX.validate. it will report the error. btw, I use pyang2.5.0(the latest version of pyang)


冯冲 Feng Chong Mobile: +86-13776612983<tel:+86-13776612983> Email: @.**@.> 发件人:Martin Bjorklund @.> 收件人:mbj4668/pyang @.> 抄 送:Fengchong (frank) @.>;Author @.> 时 间:2021-10-15 18:36:08 主 题:Re: [mbj4668/pyang] process not-supported cause compliation error (#763)

can you send me the pyang command that fails with an error?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mbj4668/pyang/issues/763#issuecomment-944194080, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZEQZMX6W3DCUSIYSMXAKTUG77Y5ANCNFSM5GBMZWOA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mbj4668 commented 2 years ago

ok, so the command is pyang *.yang. This wil give: huawei-pic.yang:55: error: node huawei-devm::lpu-boards is not found.

This is as expected, since huawei-devm-deviations-NE8000M8M14.yang deviates-away lpu-boards.

If you instead apply the deviations at the end, it "works", e.g.: pyang huawei-devm.yang huawei-pic.yang huawei-devm-deviations-NE8000M8M14.yang

lllyfeng commented 2 years ago

I don't think so. martin.

our user don't know the dependency of yang files. the same yang files will be always got the same compilation result regardless it's order.

in this example, lf huawei-devm and huawei-pic work well, and if the product don't support lpu boards. so they write a yang deviation to tailor the lpu boards. I think it's reasonable and these yang files should be compiled successfully other than depend CORRECT order.

AND I think the context should be recompile if any new yang file is added. because if the new yang file contains not - supported deviation, it maybe break the validation of other modules.for example, a node maybe reference the tailored node.


冯冲 Feng Chong Mobile: +86-13776612983<tel:+86-13776612983> Email: @.**@.> 发件人:Martin Bjorklund @.> 收件人:mbj4668/pyang @.> 抄 送:Fengchong (frank) @.>;Author @.> 时 间:2021-10-15 19:08:28 主 题:Re: [mbj4668/pyang] process not-supported cause compliation error (#763)

ok, so the command is pyang *.yang. This wil give: huawei-pic.yang:55: error: node huawei-devm::lpu-boards is not found.

This is as expected, since huawei-devm-deviations-NE8000M8M14.yang deviates-away lpu-boards.

If you instead apply the deviations at the end, it "works", e.g.: pyang huawei-devm.yang huawei-pic.yang huawei-devm-deviations-NE8000M8M14.yang

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mbj4668/pyang/issues/763#issuecomment-944212452, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZEQZPJ2GFHEYKRMQTBW2DUHADSTANCNFSM5GBMZWOA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mbj4668 commented 2 years ago

well, you are writing the compiler, you can ensure that the module are added to the context in the correct order. this is not a bug in pyang.

lllyfeng commented 2 years ago

martin. I don't know the order. if you require a user to know the correct order, user might need rewrite a yang parser. I think it's pyang's issue.


冯冲 Feng Chong Mobile: +86-13776612983<tel:+86-13776612983> Email: @.**@.> 发件人:Martin Bjorklund @.> 收件人:mbj4668/pyang @.> 抄 送:Fengchong (frank) @.>;Author @.> 时 间:2021-10-15 19:57:41 主 题:Re: [mbj4668/pyang] process not-supported cause compliation error (#763)

well, you are writing the compiler, you can ensure that the module are added to the context in the correct order. this is not a bug in pyang.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/mbj4668/pyang/issues/763#issuecomment-944238716, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABZEQZLPRBC2RD2ZRS54JA3UHAJLFANCNFSM5GBMZWOA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.