cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1805
Views
3
Helpful
8
Replies

I'm having a problem trying to compile with "pyang" a yang module.

mitshett
Cisco Employee
Cisco Employee

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

8 Replies 8

Jan Lindblad
Cisco Employee
Cisco Employee

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.

I am confused , how it is able to take other import.

Can you give command  to set path

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>

Hi Jan,

  1. I tried with command what you posted earlier but still getting sameerror
  2. what we are observing is in tailf-ncs-devices.yang ,its reports module not found for all instances of 'tailf:action'

I am hoping something to do with tailf-ncs-devices.yang , beacause if i remove  or comment tailf -ncs-device yang it works fine


Could you post your actual command, so we can see what you do?

Below  are the two commands which we tried

1. pyang -f sample-xml-skeleton -p /root/nso-4.4.1.3/src/ncs/yang/tailf-ncs.yang -p /root/nso-4.4.1.3/src/ncs/yang/tailf-ncs-devices.yang -o text.xml asr-ruledef.yang

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

(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

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: