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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/src/clixon_xml_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,22 @@ xml_merge1(cxobj *x0, /* the target */
x1cname = xml_name(x1c);
/* Get yang spec of the child */
if ((yc = yang_find_datanode(y0, x1cname)) == NULL){
/*
* Actually the CLICON_YANG_SCHEMA_MOUNT option should be checked below
* to be consistent with what is done e.g. in
* clixon_datastore_write.c::text_modify() when yang_find_datanode()
* returns NULL.
* However the clixon_handle needed to check this option is not
* available here.
* 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.

*/
if (yang_flag_get(y0, YANG_FLAG_MOUNTPOINT))
yc = xml_spec(x1c);
}
if (yc == NULL) {
if (reason){
if ((cbr = cbuf_new()) == NULL){
clixon_err(OE_XML, errno, "cbuf_new");
Expand Down