Closed RimShao closed 2 years ago
From the example I received this is the constellation:
main-module includes some submodules:
module test-module {
yang-version 1.1;
namespace urn:ietf:params:xml:ns:yang:test-module;
prefix ts-mod;
include sub-module0;
include sub-module1;
include sub-module2;
}
sub-module0 defines a contianer
:
submodule sub-module0 {
yang-version 1.1;
belongs-to test-module {
prefix ts-mod;
}
container "container" {
}
}
sub-module1 has an augment
to enhance the container:
submodule sub-module1 {
yang-version 1.1;
belongs-to test-module {
prefix ts-mod;
}
include "sub-module0";
augment /container {
leaf leaf_from_sub1 {
type int64;
}
}
}
sub-module2 has an augment
to enhance the container and uses a leaf from sub-module1 augment as leafref
:
submodule sub-module2 {
yang-version 1.1;
belongs-to test-module {
prefix ts-mod;
}
include sub-module0;
augment /container {
leaf leaf_from_sub2 {
type leafref {
path "/container/leaf_from_sub1";
}
}
}
}
The error you posted appears because the reference from sub-module2 to sub-module1 over path "/container/leaf_from_sub1";
can not be resolved.
@RimShao
I was able to fix my test case by including the sub-module1
in sub-module2
so that the augment
from sub-module1 is applied.
submodule sub-module2 {
yang-version 1.1;
belongs-to test-module {
prefix ts-mod;
}
include sub-module0;
// need to include in order to reference augments from sub-module1
include sub-module1;
augment /container {
leaf leaf_from_sub2 {
type leafref {
path "/container/leaf_from_sub1";
}
}
}
}
From the stacktrace you posted, you could try to include test-policy-cncfw
in test-ddos-cncfw
. Please let me know if it works or not.
Hi Dennis,
Thanks for the information.
yang-lsp 0.3.1 doesn't have this problem, and neither pyang/confdc validation result reports this submodule missing error.
Is there improvement needed in yang-lsp?
Thanks.
//BR Rim
Hi Dennis,
Have tried include test-policy-cncfw in test-ddos-cncfw, the problem still exists.
//BR Rim
@RimShao
yang-lsp 0.3.1 doesn't have this problem, and neither pyang/confdc validation result reports this submodule missing error.
I see, thanks for the hint. Than it meight be ralted to #216 I will check that
@RimShao Serializer is now more lax when serializing objects that are not in actual scope, but have a resolved target element and corresponding text node.
Please try the latest v0.7.1 release (probably still syncing with maven repos) or the latest Snapshot
Hi,
Encounter xpath serialization issue as below, send the code to reproduce problem separately. Thanks.