cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2003
Views
0
Helpful
1
Replies

Can someone explain tailf:dependency and how to use it?

macauley
Level 1
Level 1

Started to compile another device last night and ran into a bunch of the following errors:

  • error: The 'when' expression must have a tailf:dependency.

Here are a couple of examples of YANG snippets causing the errors:

 

    leaf fec-type {
      when "(ancestor::port/port-type = 'client') or (ancestor::port/port-type = 'client-subport')";
      type types:otuk-fec;
      default "G709";
      description "The FEC type of client OTUk.";
    } 

    leaf tx-trc {
      when "ancestor::card/switching-type = 'tdm'";
      type types:tti-type-15;
      description "The transmitter trc(trail trace identification)";
    }      
      
    uses common-otn:als-prop {
      when "ancestor::card/card-mode =  'regen'";
    }

 

 

I read the section on tailf:dependency in NSO 5.3.0.1 Manual Pages NCS man-pages, Volume 5 but being new to NCS this is beyond my understanding at the moment.  Can anyone explain to me is simple terms what I am required to do?

 

Thank you!

1 Reply 1

frjansso
Cisco Employee
Cisco Employee

I will try.

 

In your example, fec-type depends on another leaf called port-type. That means when someone make a change to port-type, NSO must check if the when-statement in fec-type still holds true or not.

 

To be efficient about this, NSO marks port-type has having a dependent leaf that has to be validated on change.

 

If you get the error/warning you get, it means NSO cannot figure out the dependency. If you don't fix this (turn of the error on that warning) you can potentially have a huge performance degradation. NSO now only knows that fec-type depends on something, but not on what. So for EVERY change in CDB, NSO will check fec-type's when statement, this can be VERY costly.

 

So to you specific problem, I've never used ancestor in NSO XPath, I'd recommend that you try relative paths, e.g. when "../port-type='client'" and NSO should be able to sort out the dependencies.

 

If you cannot figure it out, please share the YANG model and I can take a look.