-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue in referencing definitions from the same module when using submodules. #54
Comments
I'm taking a look
…On Thu, Jun 15, 2023, 3:28 AM David Abraham Mathews < ***@***.***> wrote:
Prior to #50 <#50>, the yang files
mentioned below were getting loaded succesfuly without any errors. But
after #50 <#50>, the following
error is thrown.
*module_core/submodule_1/root-list-submodule1/leaf-B - typedef
new-type-submodule2 not found*
As per RFC7950 section , When an external module referece from an imported
module is used, then we must use prefix followed by ":" , BUT If there are
references to definitions in the same local module or submodules , then it
is not mandatory that we use prefix followed by ": " to refer to local
referecnes within the module of submodule. We MAY or MAY NOT use ":" . So,
in case of included submodules, we should support referencing in both ways
by a) by using ";" and b) without using ":'
[image: image]
<https://user-images.githubusercontent.com/11210436/246027745-0c5cf12a-6eb9-44a2-854c-5762ab1b9684.png>
*Previous to #50 <#50>, we were
able to load it succesfully. Is it possible to maintain the same behaviour
now too?*
module_core.yang
module module_core {
namespace "urn:netcracker:params:module_core";
prefix module_core;
yang-version 1.1;
description "This is main Module";
include submodule_1;
include submodule_2;
}
submodule1.yang
submodule submodule_1 {
yang-version 1.1;
description "Submodule-1 with list";
belongs-to "module_core" {
prefix "module_core";
}
list root-list-submodule1 {
leaf leaf-A {
type string;
default "Success";
}
leaf leaf-B {
type new-type-submodule2;
}
uses the_only_group;
}
grouping the_only_group {
leaf leaf-from-group {
type new-type-submodule2;
}
leaf-list leaf-list-from-group {
type string;
default "ok";
}
}
}
submodule2.yang
submodule submodule_2 {
yang-version 1.1;
description "Submodule-2 with typedef";
belongs-to "module_core" {
prefix "module_core";
}
typedef new-type-submodule2 {
description "New type definition";
type uint16 {
range "10 .. 2000";
}
default 100;
units parrots;
}
}
—
Reply to this email directly, view it on GitHub
<#54>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAACA7TCE7OOGOBD6Z6NWV3XLK2SJANCNFSM6AAAAAAZHNE2HY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
i found the problem, hopefully this will work for you |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prior to #50, the yang files mentioned below were getting loaded succesfuly without any errors. But after #50, the following error is thrown.
module_core/submodule_1/root-list-submodule1/leaf-B - typedef new-type-submodule2 not found
As per RFC7950 section , When an external module referece from an imported module is used, then we must use prefix followed by ":" , BUT If there are references to definitions in the same local module or submodules , then it is not mandatory that we use prefix followed by ": " to refer to local referecnes within the module of submodule. We MAY or MAY NOT use ":" . So, in case of included submodules, we should support referencing in both ways by a) by using ";" and b) without using ":'
Previous to #50, we were able to load below yang files succesfully. Is it possible to maintain the same behaviour now too?
module_core.yang
submodule1.yang
submodule2.yang
The text was updated successfully, but these errors were encountered: