Added validation for leafref forward and nackward references.

This commit is contained in:
Olof hagsand 2017-07-18 19:56:54 +02:00
parent 96f341d8fc
commit 1b6c9aacbe
11 changed files with 295 additions and 49 deletions

View file

@ -275,9 +275,10 @@ yang2cli_var_sub(clicon_handle h,
if (helptext)
cprintf(cb0, "(\"%s\")", helptext);
if (completion){
#if 0
if (type && (strcmp(type, "leafref") == 0)){
yang_stmt *ypath;
/* XXX only for absolute xpath */
if ((ypath = yang_find((yang_node*)ytype, Y_PATH, NULL)) == NULL){
clicon_err(OE_XML, 0, "leafref should have path sub");
goto done;
@ -290,6 +291,7 @@ yang2cli_var_sub(clicon_handle h,
ypath->ys_argument);
}
else
#endif
if (cli_expand_var_generate(h, ys, cvtype, cb0,
options, fraction_digits) < 0)
goto done;