I'm trying to define a container in a sub module as below
submodule sub-module {
belongs-to main-module{
prefix "sub";
}
grouping my-container-group {
container my-container {
leaf id {
type string;
}
leaf value {
type string;
}
}
}
}
and use this container in the main-module to create a list as below
module main-module {
namespace "http://example-ns";
prefix "sub";
include sub-module;
list my-list {
key id;
uses my-container-group;
}
}
But, the pyang throws an error as below
test# pyang main-module.yang -f tree
main-module.yang:10: error: the key "id" does not reference an existing leaf
module: main-module
+--rw my-list* [id]
+--rw my-container
+--rw id? string
+--rw value? string
What am I doing wrong here?