Skip to content
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

Duplicate node error using Cisco XR yang models #834

Open
teflux opened this issue May 16, 2023 · 1 comment
Open

Duplicate node error using Cisco XR yang models #834

teflux opened this issue May 16, 2023 · 1 comment

Comments

@teflux
Copy link

teflux commented May 16, 2023

Using the Cisco Unified Models located at https://github.com/YangModels/yang/tree/main/vendor/cisco/xr/742 we are receiving a duplicate node error as follows:

$ generator -path . -output_file /tmp/xr.go Cisco-IOS-XR-um-mpls-te-cfg.yang 
F0516 09:45:29.202966   20121 generator.go:382] ERROR Generating GoStruct Code: Cisco-IOS-XR-um-mpls-te-cfg.yang:5258:3: Duplicate node "logging" in "interface" from:
   Cisco-IOS-XR-um-mpls-te-cfg.yang:2253:5: logging
   Cisco-IOS-XR-um-interface-cfg.yang:229:5: logging

Viewing the yang models using pyang the model renders correctly.

docker run --rm -v $(pwd):/yang ghcr.io/hellt/pyang pyang -f tree  Cisco-IOS-XR-um-mpls-te-cfg.yang

The Cisco-IOS-XR-um-mpls-te-cfg model augments Cisco-IOS-XR-um-interface-cfg where the logging node already exists.

I assume these two logging nodes should be merged when generating the structs

@wenovus
Copy link
Collaborator

wenovus commented Jun 5, 2023

Apologies for the late reply -- If by "merge" you mean resolving any differences between the two leaves and merging their properties, then this is not something we intend to support since in general they can be two different leaves with different types. If you mean to support the existence of both leaves at the same time, then ygot does not support it.

The reason is because goyang, and in extension ygot, doesn't support YANG's namespaces, therefore if in the same hierarchy the same name exists twice, even in different namespaces (in this case the augment node exists in the namespace of the augmenting module), then it will complain that there is a conflict. There is a document brainstorming on how to support this although there is currently no plan to implement it from the maintainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants