Compile YANG module using flag of -feature

Hello everyone,

I have added the below code and am expecting to that slot should enable for chassis-platform.
but it looks like it doesn’t work. Can you pls. help us resolve the issue.

brocade-diagnostics.yang

    feature platform_chassis {
        description "chassis-platform";
    }
 
    feature platform_pizzabox {
        description "pizzabox-platform";
    }
 
container diag {
        tailf:info "Commands to manage diagnostic activities";
        tailf:action turboramtest {
               tailf:actionpoint fosdiagtests;
             input {
                leaf slot {
                    if-feature platform_chassis;
                    type slotidtype;
                    mandatory true; 
                }
                leaf passcnt {
                    type uint32 {
                        range "1..10" {
                            tailf:info "NUMBER:1-10 Specifies the number of times to perform this test";
                        }
                    }
                }
            }

Makefile:

brocade-diagnostics.fxs: $(YANG_PRE_PROCESS_DIR)/brocade-diagnostics.yang $(MOD_YANG_FILES)  $(MAKEFILE_LIST)
    @echo "    Generating brocade-diagnostics.fxs"
    $(CONFDC) $(YANG_INCLUDES) --export cli --feature platform_pizzabox -c -o $@ $<

Regards,
Iyyappa.

You do not specify which ConfD release you are using, based on your other post it is quite old, so not everything I write may apply. When you specify a compile-time feature, you need to include a module name, so instead of --feature platform_pizzabox you should have --feature brocade-diagnostics:platform_pizzabox. Failing this would ConfD cause to think that all features of that module are enabled.

With more recent ConfD releases you would get “Bad features spec” error; this has been added in 7.3.

Thanks for your response. It was working fine where in confd version 4.3 and it’s not worked after confd version upgrade to 6.3.0.2.
It seems “if-feature” statement didn’t worked.

I have modified the make file what you suggested and getting the build errors.
make[6]: *** [brocade-diagnostics.fxs] Error 1
make[5]: *** [yang] Error 2
make[4]: *** [DCM_LIB] Error 2

It is entirely possible (or actually very likely) that there were backward-incompatible changes between 4.3 and 6.3.

As for the error, you are showing only make’s messages as it is leaving recursion levels, not the error message itself.

Do we’ve any other possibilities to resolve the issue… Mean do we need make any changes in the confd side?

as mvf says, you didn’t show us the actual build errors, only the makefile “excerpts”, so it’s hard to give any hints. Try getting the specific build commands that fail and their error outputs so we can try identify the problem.

Hi Josephm,

I have modified the make file as below. I don’t see any build error, but the fix is not working for chassis based platform.

brocade-diagnostics.fxs: $(YANG_PRE_PROCESS_DIR)/brocade-diagnostics.yang $(MOD_YANG_FILES) $(MAKEFILE_LIST)
@echo " Generating brocade-diagnostics.fxs"
$(CONFDC) $(YANG_INCLUDES) --export cli --feature brocade-diagnostics:platform_pizzabox -c -o $@ $<

Where I don’t see the slotid parameters for chassis based platforms.

sw0# diag turboramtest ?
Possible completions:
passcnt |
sw0# diag turboramtest

Regards,
Iyyappa.

Can we get any inputs?

The leaf slot is tagged by the feature platform_chassis, you compile with --feature brocade-diagnostics:platform_pizzabox, so the leaf is not available.

How do we achieve this?

When a data model node is tagged like

container my-data {
  if-feature my-feature;
   ...
}

you are saying that the container is available only on servers that support the feature my-feature. For ConfD it means that if you want to deploy your data model on a server that supports it, the data model must be compiled with --feature my-model:my-feature. In your case it means that slot becomes usable only if you compile your data model with --feature brocade-diagnostic:platform_chassis (disregarding whether you use other features).

You can read more about features in the YANG RFC.