05-26-2021 11:09 AM
I’m running into issues where I can’t create a Docker image based on a NETCONF NED created using this method: https://developer.cisco.com/docs/nso/guides/#!netconf-ned-builder/overview-of-the-netconf-ned-builder-workflow
I fetch the modules, selected Cisco-IOS-XE-*, then ran make-development-ned as I need the netsim support. When running make within src folder I get the same error as the attached docker build error.
It seems to be something related to the yang files but I'm not sure. I don't think I should have to go into each YANG model from the device and notate it.
Solved! Go to Solution.
05-27-2021 12:45 AM - edited 05-27-2021 12:48 AM
It is of course a good option to create tailf annotation files and add a tailf:dependency extension to each of those must statements and a tailf:code-name extension for the conflicting bits/enums/nodes.
However, It is not mandatory to do so and it may not be necessary for your use-case to address those warnings. So you can, for now, ignore the warnings by in your development NED package src/Makefile remove the "--fail-on-warnings" flag.
BTW, NSO 5.5.2 does not seem to include the "--fail-on-warning" flag in the package created from the "make-development-ned" command.
If you want to address those warnings, you can create a YANG annotation modules like this one (my-yang-module-ann.yang that annotates a my-yang-module.yang):
module my-yang-module-ann { namespace "urn:my-yang-module-ann"; prefix m-ann; import tailf-common { prefix tailf; } tailf:annotate-module " my-yang-module" tailf:annotate-statement "grouping[name='my-grouping']" { tailf:annotate-statement "container[name='my-container']" tailf:annotate-statement “leaf[name='some-leaf']" {
tailf:annotate-statement "must[condition='count(../some-list) > 0']" {
tailf:dependency "../some-list";
} } } } } }
With the development NED, just place the annotation module with the original yang module under src/yang
If you want to include the annotation file with the NED builder build, after downloading the YANG models before building the NED with the NED builder register the annotation module with the NSO NED builder by doing something like this:
$ cp /path/to/ my-yang-module-ann.yang /$MY_NSO_PROJECT/state/netconf-ned-builder/cache/$MY_NED_NAME-nc-1.0/ $ ncs_cmd -c 'mcreate "/netconf-ned-builder/project{/$MY_NED_NAME 1.0}/module{my-yang-module-ann 2021-mm-dd}"; mset "/netconf-ned-builder/project{$MY_NED_NAME 1.0}/module{my-yang-module-ann 2021-mm-dd}/namespace" "urn:my-yang-module-ann"; mset "/netconf-ned-builder/project{$MY_NED_NAME 1.0}/module{ my-yang-module-ann 2021-mm-dd}/location" "NETCONF"; mset "/netconf-ned-builder/project{$MY_NED_NAME 1.0}/module{my-yang-module-ann 2021-mm-dd}/status" "selected downloaded"'
05-27-2021 12:45 AM - edited 05-27-2021 12:48 AM
It is of course a good option to create tailf annotation files and add a tailf:dependency extension to each of those must statements and a tailf:code-name extension for the conflicting bits/enums/nodes.
However, It is not mandatory to do so and it may not be necessary for your use-case to address those warnings. So you can, for now, ignore the warnings by in your development NED package src/Makefile remove the "--fail-on-warnings" flag.
BTW, NSO 5.5.2 does not seem to include the "--fail-on-warning" flag in the package created from the "make-development-ned" command.
If you want to address those warnings, you can create a YANG annotation modules like this one (my-yang-module-ann.yang that annotates a my-yang-module.yang):
module my-yang-module-ann { namespace "urn:my-yang-module-ann"; prefix m-ann; import tailf-common { prefix tailf; } tailf:annotate-module " my-yang-module" tailf:annotate-statement "grouping[name='my-grouping']" { tailf:annotate-statement "container[name='my-container']" tailf:annotate-statement “leaf[name='some-leaf']" {
tailf:annotate-statement "must[condition='count(../some-list) > 0']" {
tailf:dependency "../some-list";
} } } } } }
With the development NED, just place the annotation module with the original yang module under src/yang
If you want to include the annotation file with the NED builder build, after downloading the YANG models before building the NED with the NED builder register the annotation module with the NSO NED builder by doing something like this:
$ cp /path/to/ my-yang-module-ann.yang /$MY_NSO_PROJECT/state/netconf-ned-builder/cache/$MY_NED_NAME-nc-1.0/ $ ncs_cmd -c 'mcreate "/netconf-ned-builder/project{/$MY_NED_NAME 1.0}/module{my-yang-module-ann 2021-mm-dd}"; mset "/netconf-ned-builder/project{$MY_NED_NAME 1.0}/module{my-yang-module-ann 2021-mm-dd}/namespace" "urn:my-yang-module-ann"; mset "/netconf-ned-builder/project{$MY_NED_NAME 1.0}/module{ my-yang-module-ann 2021-mm-dd}/location" "NETCONF"; mset "/netconf-ned-builder/project{$MY_NED_NAME 1.0}/module{my-yang-module-ann 2021-mm-dd}/status" "selected downloaded"'
05-27-2021 07:22 AM
removing "--fail-on-warning" solved this issue. Thanks a lot for the help.
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