I'm having a problem trying to compile with "pyang" a yang module.
The error looks like this:
/yang/tailf-ncs-devices.yang:1287: error: node tailf-ncs::connect is not found
/yang/tailf-ncs-devices.yang:1297: error: node tailf-ncs::sync-to is not found
/yang/tailf-ncs-devices.yang:1307: error: node tailf-ncs::sync-from is not found
/yang/tailf-ncs-devices.yang:1317: error: node tailf-ncs::disconnect is not found
/yang/tailf-ncs-devices.yang:1327: error: node tailf-ncs::check-sync is not found
/yang/tailf-ncs-devices.yang:1337: error: node tailf-ncs::check-yang-modules is not found
/yang/tailf-ncs-devices.yang:1348: error: node tailf-ncs::fetch-ssh-host-keys is not found
/yang/tailf-ncs-devices.yang:3051: error: node tailf-ncs::disconnect is not found
I don't know what I'm doing bad, I tried examples and everything and the error It's the same.
if the yang file do not contain import of any ncs named file, works fine
If a YANG file imports or includes other YANG files, you also need to have those other YANG files in the compiler's source file path, or compilation will fail. With pyang you can specify the source file path using --path=... directives.
pyang --format=<sample-xml-skeleton or whatever> --path=<where I keep my source files> --path=<where I keep even more source files> --output=<output file> <root source file>
I am hoping something to do with tailf-ncs-devices.yang , beacause if i remove or comment tailf -ncs-device yang it works fine
Below are the two commands which we tried
2.pyang -f sample-xml-skeleton -p /root/nso-188.8.131.52/src/ncs/yang/ -p /root/nso-184.108.40.206/packages/neds/cisco-staros/ -p /root/nso-220.127.116.11/packages/neds/cisco-ios/ -o text.xml asr-ruledef.yang
(1) The -p (or --path=) options are supposed to take the name of a *directory* with YANG files, not point to individual files.
(2) This works for me with other YANG files. Maybe your asr-ruledef.yang is broken?
we tried with other yang file which doesn't use import of tailf-ncs-devices.yang ,works fine for us.
We are suspecting issue with tailf-ncs-devices.yang .
Inside asr-ruledef.yang we are importing tailf-ncs.yang which is refering to tailf-ncs-devices.yang