cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1311
Views
10
Helpful
2
Replies

NETCONF NED Make Error | YANG naming overlap

crench92
Spotlight
Spotlight

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.

1 Accepted Solution

Accepted Solutions

cohult
Cisco Employee
Cisco Employee

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. 

  • The tailf:dependency statement will help NSO to not evaluate must statements XPath expressions unnecessarily when the config is committed. 
  • The tailf:code-name extension will resolve conflicts for the autogenerated Java/Python namespace class that you may or may not need to use if you add Java/Python code.

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"'

 

View solution in original post

2 Replies 2

cohult
Cisco Employee
Cisco Employee

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. 

  • The tailf:dependency statement will help NSO to not evaluate must statements XPath expressions unnecessarily when the config is committed. 
  • The tailf:code-name extension will resolve conflicts for the autogenerated Java/Python namespace class that you may or may not need to use if you add Java/Python code.

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"'

 

removing "--fail-on-warning" solved this issue.  Thanks a lot for the help.

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: