You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module snabb-pf-v1 {
namespace snabb:pf-v1;
prefix pf-v1;
list foo {
key "name";
leaf name {
type string;
}
choice bar {
mandatory true;
case case1 {
leaf case1 {
type string;
}
}
case case2 {
leaf case2 {
type string;
}
}
}
}
}
Data pf-v1.cfg
foo {
name "bar";
case1 "baz";
}
setup.lua
local basic_apps = require("apps.basic.basic_apps")
local app_graph = require('core.config')
return function (conf)
local graph = app_graph.new()
app_graph.app(graph, "source", basic_apps.Source)
app_graph.app(graph, "sink", basic_apps.Sink)
app_graph.link(graph, "source.output -> sink.input")
return {foo=graph}
end
schema.lua
local yang = require("lib.yang.yang")
local pf_schema = yang.add_schema_file("snabb-pf-v1.yang")
local config = yang.load_configuration("pf-v1.cfg", { schema_name = "snabb-pf-v1" })
because there is no handler for a production of type choice.
There is another bug which may or may not be related. Run ptree with
$ sudo ./snabb ptree --name foo snabb-pf-v1.yang setup.lua pf-v1.cfg
pf-v1.cfg: loading source configuration
Warning: No assignable CPUs declared; leaving data-plane process without assigned CPU.
No CPUs available; not binding to any NUMA node.
Schema
snabb-pf-v1.yang
Data
pf-v1.cfg
setup.lua
schema.lua
Writing the compiled configuration fails
The error is hidden by a
pcall
. The actual failure occurs insnabb/src/lib/yang/binary.lua
Line 111 in 771b55c
choice
.There is another bug which may or may not be related. Run
ptree
withRe-loading the same configuration fails
A workaround is to wrap the choice node in a container.
The text was updated successfully, but these errors were encountered: