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

NSO 5.5.4 Yang derive from cisco-ios

tsiemers1
Spotlight
Spotlight

Trying to fix a package to work that seems to have broken with either NSO 5.5 or the Cisco ned for ios (6.77). When working I had this in the yang which made sure the leafref only ran when it was derived from cisco-ios ned.

leaf interfaceXEName {
      when
        "derived-from-or-self(/ncs:devices/ncs:device[ncs:name=current()/../deviceName]/ncs:device-type/ncs:cli/ncs:ned-id, 'cisco-ios-cli:cisco-ios-cli')";
      description
        "List of GigabitEthernet interfaces specific to cisco-ios-cli ned devices";

      type leafref {
        path "/ncs:devices/ncs:device[ncs:name=current()/../deviceName]/ncs:config/ios:interface/ios:GigabitEthernet/ios:name";
      }
    }

This gives the following error when running 'make clean all'

make: *** [Makefile:26: ../load-dir/formItential.fxs] Error 1

What method is available to run this? Full yang and Makefile below.

yang

module formItential {

  namespace "http://example.com/formItential";
  prefix formItential;

  import ietf-inet-types {
    prefix inet;
  }
  import tailf-common {
    prefix tailf;
  }
  import tailf-ncs {
    prefix ncs;
  }
  import tailf-ned-cisco-ios {
    prefix ios;
  }

  import cisco-ios-cli {
    prefix cisco-ios-cli;
  }

  description
    "Bla bla...";

  revision 2016-01-01 {
    description
      "Initial revision.";
  }

  list formItential {
    description "This is an RFS skeleton service";

    key name;
    leaf name {
      tailf:info "Unique service id";
      tailf:cli-allow-range;
      type string;
    }

    uses ncs:service-data;
    ncs:servicepoint formItential-servicepoint;

    leaf deviceName {
      type leafref {
        path /ncs:devices/ncs:device/ncs:name;
      }
    }

    leaf interfaceXEName {
      when
        "derived-from-or-self(/ncs:devices/ncs:device[ncs:name=current()/../deviceName]/ncs:device-type/ncs:cli/ncs:ned-id, 'cisco-ios-cli:cisco-ios-cli')";
      description
        "List of GigabitEthernet interfaces specific to cisco-ios-cli ned devices";

      type leafref {
        path "/ncs:devices/ncs:device[ncs:name=current()/../deviceName]/ncs:config/ios:interface/ios:GigabitEthernet/ios:name";
      }
    }
  }
}

Makefile

all: fxs
.PHONY: all

# Include standard NCS examples build definitions and rules
include $(NCS_DIR)/src/ncs/build/include.ncs.mk

src=$(wildcard yang/*.yang)
DIRS = ../load-dir java/src/$(JDIR)/$(NS)
FXS = $(SRC:yang/%.yang=../load-dir/%.fxs)

## Uncomment and patch the line below if you have a dependency to a NED
## or to other YANG files
# YANGPATH += ../../<ned-name>/src/ncsc-out/modules/yang \
#       ../../<pkt-name>/src/yang
YANGPATH += ../../cisco-ios-cli-6.77/src/ncsc-out/modules/yang \
YANGPATH += ../../cisco-ios-cli-6.77/src 

NCSCPATH   = $(YANGPATH:%=--yangpath %)
YANGERPATH = $(YANGPATH:%=--path %)

fxs: $(DIRS) $(FXS)

$(DIRS):
        mkdir -p $@

../load-dir/%.fxs: yang/%.yang
        $(NCSC)  `ls $*-ann.yang  > /dev/null 2>&1 && echo "-a $*-ann.yang"` \
                --fail-on-warnings \
                $(NCSCPATH) \
                -c -o $@ $<

clean:
        rm -rf $(DIRS)
.PHONY: clean

 

 

1 Accepted Solution

Accepted Solutions

hazad
Cisco Employee
Cisco Employee

The error message in your description is showing what Makefile target it was that failed. But it doesn't show the actual failure. Did you get any more output or error messages before the output "make: *** [Makefile:26: ../load-dir/formItential.fxs] Error 1"? I can see from your Makefile that the compiler is called with the --fail-on-warning flag, so it might have been a warning that failed it.

View solution in original post

2 Replies 2

hazad
Cisco Employee
Cisco Employee

The error message in your description is showing what Makefile target it was that failed. But it doesn't show the actual failure. Did you get any more output or error messages before the output "make: *** [Makefile:26: ../load-dir/formItential.fxs] Error 1"? I can see from your Makefile that the compiler is called with the --fail-on-warning flag, so it might have been a warning that failed it.

That was it. Once I deleted --fail-on-warning from the Makefile it complied and worked in NSO. No output on the failure was given but I'll try to debug the make command and see.

Thanks