08-07-2016 05:39 PM
Can anyone help me here? I'm seeing errors using pyang with the downloaded Yang schemas from ODL. I'm running distribution-karaf-0.4.2-Beryllium-SR2.
I downloaded all the yang schema files from the server (http://localhost:8181/restconf/modules...)
I get errors on basically all of them. For example,
[gibson@rickenbacker yang]$ pyang -f tree opendaylight-inventory
opendaylight-inventory:1: error: module "yang-ext" not found in search path
opendaylight-inventory:1: error: module "ietf-inet-types" not found in search path
opendaylight-inventory:1: warning: imported module yang-ext not used
opendaylight-inventory:21 (at opendaylight-inventory:18): warning: "mandatory" statement for a key leaf is ignored
opendaylight-inventory:21: error: no module with the namespace "urn:opendaylight:yang:extension:yang-ext" is imported
opendaylight-inventory:21 (at opendaylight-inventory:21): warning: "mandatory" statement for a key leaf is ignored
opendaylight-inventory:27: error: no module with the namespace "urn:opendaylight:yang:extension:yang-ext" is imported
opendaylight-inventory:27: warning: explicit config statement is ignored
opendaylight-inventory:33: error: no module with the namespace "urn:opendaylight:yang:extension:yang-ext" is imported
opendaylight-inventory:33: warning: explicit config statement is ignored
opendaylight-inventory:39: error: no module with the namespace "urn:opendaylight:yang:extension:yang-ext" is imported
opendaylight-inventory:39: warning: explicit config statement is ignored
opendaylight-inventory:45: error: no module with the namespace "urn:opendaylight:yang:extension:yang-ext" is imported
opendaylight-inventory:45: warning: explicit config statement is ignored
module: opendaylight-inventory
x--rw nodes!
+--rw node* [id]
+--rw id node-id
+--rw node-connector* [id]
+--rw id node-connector-id
notifications:
x---n node-removed
| +--ro node-ref? node-ref
x---n node-connector-removed
| +--ro node-connector-ref? node-connector-ref
x---n node-updated
| +--ro node-ref? node-ref
| +--rw id? node-id
| +--rw node-connector* [id]
| +--rw id node-connector-id
x---n node-connector-updated
+--ro node-connector-ref? node-connector-ref
+--rw id? node-connector-id
However, "yang-ext" schema file is in the same directory with all the other files. I see similar errors running other files.
Anyone have a suggestion?
08-15-2016 09:02 AM
hmmm - not sure. I can do a "pyang -f tree opendaylight-inventory@2013-08-19.yang" in ODL's cache/schema directory.
how did you download the modules?
08-15-2016 10:02 AM
I'm just downloading from the server with the URL for the schema like...
http://192.168.5.102:8181/restconf/modules/module/opendaylight-inventory/2013-08-19/schema
I can do it with the browser or wget or curl and I get the same result shown above. Do the files get corrupted with that method?
08-16-2016 01:03 PM
ah ok. So if you do that then the schemas are downloaded in YIN, not YANG (I'm not sure why).
so you need to convert each schema file using e.g. "pyang -f yang schema > yang-ext.yang"
let me know if that works
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 community: