* CLI expansion of leafrefs default behavior changed

* In the autocli and handcrafted CLI:s using `expand_dbvar()` the CLI expansion followed the leafrefs to the sources, ie the origin of the leafrefs
    * Instead leafref expansion now only looks at the leafrefs
This commit is contained in:
Olof hagsand 2022-05-10 10:06:43 +02:00
parent 614c927343
commit a49cf41d1e
4 changed files with 36 additions and 5 deletions

View file

@ -277,7 +277,8 @@ expand_dbvar(void *h,
goto done;
}
cprintf(cbxpath, "%s", xpath);
if ((ytype = yang_find(y, Y_TYPE, NULL)) != NULL &&
if (clicon_option_bool(h, "CLICON_CLI_EXPAND_LEAFREF") &&
(ytype = yang_find(y, Y_TYPE, NULL)) != NULL &&
strcmp(yang_argument_get(ytype), "leafref") == 0){
/* Special case for leafref. Detect leafref via Yang-type,
* Get Yang path element, tentatively add the new syntax to the whole