- Fixed: [Duplicate lines emitted by cli_show_config (cli output style) when yang list element has composite key](https://github.com/clicon/clixon/issues/258)

This commit is contained in:
Olof hagsand 2021-09-09 13:33:51 +02:00
parent d1ed4ecd7d
commit ca14879e8c
2 changed files with 5 additions and 3 deletions

View file

@ -78,6 +78,7 @@ Users may have to change how they access the system
### Corrected Bugs
* Fixed: [Duplicate lines emitted by cli_show_config (cli output style) when yang list element has composite key](https://github.com/clicon/clixon/issues/258)
* Fixed: [JSON leaf-list output single element leaf-list does not use array](https://github.com/clicon/clixon/issues/261)
* Fixed: Netconf diff callback did not work with choice and same value replace
* Eg if YANG is `choice c { leaf x; leaf y }` and XML changed from `<x>42</x>` to `<y>42</y>` the datastrore changed, but was not detected by diff algorithms and provided to validate callbacks.

View file

@ -407,17 +407,18 @@ cli_xml2cli(cxobj *xn,
(*fn)(stdout, "\n");
}
/* For lists, print cbpre before its elements */
if (yang_keyword_get(ys) == Y_LIST)
(*fn)(stdout, "%s\n", cbuf_get(cbpre));
/* Then loop through all other (non-keys) */
xe = NULL;
while ((xe = xml_child_each(xn, xe, -1)) != NULL){
if (yang_keyword_get(ys) == Y_LIST){
if ((match = yang_key_match(ys, xml_name(xe))) < 0)
goto done;
if (match){
(*fn)(stdout, "%s\n", cbuf_get(cbpre));
if (match)
continue; /* Not key itself */
}
}
if (cli_xml2cli(xe, cbuf_get(cbpre), gt, fn) < 0)
goto done;
}