01-10-2023 12:09 PM
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
Solved! Go to Solution.
01-16-2023 11:48 PM
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.
01-16-2023 11:48 PM
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.
01-19-2023 09:02 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide