Ietf-entity.yang compile Error with pyang 1.5 and 1.6


I need to compile ietf-entity.yang in my package but i got the following error : ietf-entity.yang:2: error: bad value “1.1” (should be version)
ietf-entity.yang:915: error: XPath function “derived-from-or-self” is not defined in the XPath context

I’am using the pyang command delivered under my confd package.

Can any one tell what is the roor cause ?

Many thanks for your Help.


The two errors that you are running into pertain to YANG 1.1. There is currently no support of YANG 1.1 by the latest ConfD 6.1 release. YANG 1.1 will be supported by ConfD 6.3 in the end of 2016 time frame. There may be partial support of YANG 1.1 earlier.

There is no workaround to apply it? I should wait confined 6.3 version?
Many thanks for your help.

If you are OK with working on a subset of the YANG model, you can take out the YANG 1.1 specific things from ietf-entity.yang.

You can remove or comment out the following line:

yang-version 1.1;

and take out or comment out the following block:

    when 'derived-from-or-self(../class,
                             "iana-entity", "sensor")' {
        "Sensor data nodes present for any entity of type 'sensor'";

With the above statements removed, you should be able to compile the YANG model in ConfD 6.1.