-
Notifications
You must be signed in to change notification settings - Fork 346
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
Leaf in when constraint not found in combination with augment and choice/case #650
Comments
Hi, It's a known issue since |
do you know if this is something that are being addressed? I think this one is my show stopper for compiling the Cisco native models. Its related to #729 and #836 I know the Cisco yang models are fairly buggy, but I have been going though the problems one-by-one and I have a working set of yang models. At least according to libyang (yanglint). But this is blocking me for compiling the models. Like the others I am getting a ton of these faults
Im pretty sure its this problem as its augments the interfaces in the Cisco-IOS-XE-bgp.yang from the native model and its also using choices.. What can I do to help this along? Esben |
@hyberdk please verify this fix on the modules you have. |
Hi @mbj4668, thank you so much for your feedback! I tested it again, but unfortunately my model is still failing with the same fault. I have been stepping through the code and I am not too sure, but looking at this: In line 2757 i searches for the "ptr" (is that pointer?), it does not find any as there are no children in the pmodule. This sets ptr = None. In line 2762 it searches for includes again but, since its searching in the "Cisco-IOS-XE-interfaces" submodule, there are no "includes" there.. I think the problem is that the reference to /native/interface/* are in the upstream native module, but it does not search that one only the sub-module.. From what I can tell, we need to instruct pyang that if the current module is a "sub-module" it needs to include the "belongs-to" module in the search and not only the submodule and its includes.. does that make sense? I will try and clean up the models a bit and push it to my github so you can test with the same files.. I have tried to make a test-case but I have not been able to do so yet.. ;-( but again, many many thanks for reaching out.. I have been stuck on this for months now.. Esben |
See my comment in #729 as well. The XE models are "broken" in the sense that they don't follow the scoping rules for YANG 1. I just pushed another fix to the branch |
See the following example model, which I minimized as far as possible from the case we encounter:
example.zip
pyang gives the following warning for this:
example.yang:30: warning: node "example::type" is not found in "example::inline-frame-processing"
This is occurring in 2.3.0, and also already in 2.2.1, but not in 1.7.5.
Note that it succeeds if:
The text was updated successfully, but these errors were encountered: