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

Fix for showing state below mountpoints #521

Merged
merged 1 commit into from
May 22, 2024

Conversation

colinhusu
Copy link
Contributor

Generating state for a yang module that has both state and config below a mountpoint fails with an error:

XML node %s/%s has no corresponding yang specification (Invalid XML or wrong Yang spec

This is because netconf_trymerge() will be called to merge state and config, which will in turn trigger a problem in xml_merge1(). Fix that.

* So check for the YANG_FLAG_MOUNTPOINT flag on y0 as an alternative.
* It will only have been set if CLICON_YANG_SCHEMA_MOUNT is enabled
* and it will be set for exactly those cases where the xml_spec()
* call is needed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a reasonable assumption.
Please remove the "//", see https://github.com/clicon/clixon/blob/master/CONTRIBUTING.md#comments
I see the CLICON_YANG_SCHEMA_MOUNT as getting to be default true eventually as the functionality matures

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed the // line, but have left the /**/ comment left intact, I hope this is OK.

xml_merge1() fails right now when merging trees which have data
below mountpoints with an error message like this:

XML node %s/%s has no corresponding yang specification (Invalid XML or wrong Yang spec?

This is because xml_merge1() does not handle mountpoints. Adjust
it accordingly.

Note that this was encountered when generating the state of a a yang
module that has both state and config below a mountpoint. In that case
netconf_trymerge() will be called to merge state and config and will
trigger the problem in xml_merge1().
@olofhagsand olofhagsand merged commit d29b7e5 into clicon:master May 22, 2024
6 checks passed
@colinhusu colinhusu deleted the mountpoint_state_fix branch May 22, 2024 12:29
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

Successfully merging this pull request may close these issues.

None yet

2 participants