Compiling deviation, augmentation, annotation files

Hi,

When I compile with confdc YANG modules that have deviation and\or augmentation and\or annotation:

  1. which .fxs files should be located at the loadpath? only the .fxs of the main module or all of them?
  2. Should I compile only the main module with flag of --deviation or the deviaiton file should be compiled as well?
  3. what about augmentation files? they have any flag in the command line of compilation?

I will give specific example so it will be clearly. I have the following modules:
ietf-isis@2017-07-25.yang - The standard module for ISIS
eci-isis-dev@2017-07-19.yang - The deviation file for ietf-isis
eci-isis-aug@2017-07-19.yang - The augmentation file for ietf-isis
eci-isis-ann@2017-07-19.yang - The annotation file for ietf-isis

What should be compile and which command?
Which files should be copied to confd loadpath.

Thanks,

  1. With annotation and deviation only the main fxs-file should me in the load path (there won’t be any fas-files for the annotation/deviation files).
  2. Yes.
  3. No. You compile a YANG-file containing augment statements the same way as you compile other YANG-files.

Hi,

I have 2 yang modules:

  1. ietf-interfaces@2014-05-08.yang
  2. eci-interfaces-dev-npt1800@2017-07-25.yang

I compile the first module with the following command:
confdc -c --deviation eci-interfaces-dev-npt1800@2017-07-25.yang --fail-on-warnings -o ietf-interfaces@2014-05-08.fxs ietf-interfaces@2014-05-08.yang

And I am getting the following error:
5-Sep-2017::17:04:19.814 rcohen1_Host1 confd[21667]: - The namespace urn:eci:params:xml:ns:yang:eci-interfaces-dev-npt1800 (referenced by urn:ietf:params:xml:ns:yang:ietf-interfaces) could not be found in the loadPath.
“The namespace urn:eci:params:xml:ns:yang:eci-interfaces-dev-npt1800 (referenced by urn:ietf:params:xml:ns:yang:ietf-interfaces) could not be found in the loadPath.\n”

When I compile eci-interfaces-dev-npt1800@2017-07-25.yang as well and put his .fxs in the loadpath it’s OK but according to your instructions only the main .fxs should be in the load path and not the .fxs of the deviation file.

Hi,

Can you please answer this question?

Thanks,

I guess you don’t import ietf-interfaces@2014-05-08.yang in eci-interfaces-dev-npt1800@2017-07-25.yang.

If you add the following deviation module to the intro/1-2-3-start-query-model example, compile it using the same confdc command you used you will have a working deviation.

module dhcpd-deviations {

  namespace "http://tail-f.com/ns/example/deviations/dhcpd";
  prefix dhcpd-deviations;

  import dhcpd {
    prefix dhcpd;
  }

  deviation "/dhcpd:dhcp/dhcpd:logFacility" {
    deviate replace {
      default kern;
    }
  }
}

This is the normal case, i.e. when your deviation module has only ‘deviation’ statements. However if it also has separate definitions, notably ‘typedef’, that are used by the deviations, you must also compile the deviation module and place it in the load path.

Hi,

Thanks for your clarification. it solve the problem. indeed I had typedef in the deviated YANG module.
Can it be problematic to put always the deviated YANG modules in the loadpath?
Why do we have this limitation?

Thanks,

Evyatar

No, it should be OK.

I assume that you use “limitation” to refer to the fact that you need the compiled deviation module in runtime if has separate definitions… I think it is pretty logical - compiling the target module with --deviation applies the ‘deviation’-statements from the deviation module, which effectively modify the target module. If one of those deviations makes the target module use a type that is defined in the deviation module, the deviation module needs to be present at runtime to provide the type definition, just like any other modules with type definitions used by the target module.