10-12-2017 02:45 AM - edited 03-01-2019 04:01 AM
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
10-16-2017 01:11 AM
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.
10-16-2017 01:17 AM
I am confused , how it is able to take other import.
Can you give command to set path
10-16-2017 01:41 AM
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>
10-16-2017 08:48 AM
Hi Jan,
I am hoping something to do with tailf-ncs-devices.yang , beacause if i remove or comment tailf -ncs-device yang it works fine
10-17-2017 12:18 AM
Could you post your actual command, so we can see what you do?
10-17-2017 12:45 AM
Below are the two commands which we tried
2.pyang -f sample-xml-skeleton -p /root/nso-4.4.1.3/src/ncs/yang/ -p /root/nso-4.4.1.3/packages/neds/cisco-staros/ -p /root/nso-4.4.1.3/packages/neds/cisco-ios/ -o text.xml asr-ruledef.yang
10-17-2017 12:56 AM
(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?
10-17-2017 01:01 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide