-
Notifications
You must be signed in to change notification settings - Fork 72
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
(CLI) the description of a used grouping is shown instead of the encapsulating container #124
Comments
Yes, I see this issue for the autocli. RFC 7950 is not explicit in this subject (see 5.5/7.12/7.13) and maybe the autocli is not really in scope of the RFC, ie how to genera CLI statements from YANG.
This is what the code does, it copies the nodes in the grouping into the uses statement. The effect for the autocli is that there are two descriptions, and their order determines which is shown (the two cases above). The second hint the error in 7.13.4:
which seems to indicate that you cannot have two identical nodes eg "leaf ip", in the two cases. The easy way out here would therefore be to point at 7.13.4 and say that this is not allowed (and maybe add an error in the uses expansion code). But I could see there being a benefit to have specialized descriptions for comments. In that case I assume that the principle of least surprise would be that you would use the more specialized description (if it exists), and to use the generalized description if there is no specific description. How does that sound? |
Totally agree, especially considering that one might have more than one grouping in a container and that all groupings and containers are advised to all have a description (RFC 8407 at 4.14). |
regarding the case that a container doesn't have a description and there are multiple nested groupings with descriptions:
personally I am not a fan of taking a grouping's description as a description of a container unless the container only encapsulates a single grouping without any other node (e.g. no other leaves). As I see it, a grouping's description is meant to only describe the structure of that grouping. |
That makes sense:
Its also a simple solution, I will go with that, ie ignore the groupings description, do not copy it into the "uses" instance. |
Fixed: |
CLI takes the description of a grouping even though the container has its own description.
example:
in this example, the description shown for container a should be "container desc", but instead "group desc" is shown.
also, swapping the lines inside the container will change the description shown to the expected "container desc".
The text was updated successfully, but these errors were encountered: