- 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

@ -407,16 +407,17 @@ 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;