fixed empty cli gen err
This commit is contained in:
parent
5ae1aeb427
commit
fd2a5db31b
3 changed files with 7 additions and 3 deletions
|
|
@ -3,7 +3,6 @@
|
|||
## Upcoming 3.3.2
|
||||
|
||||
### Known issues
|
||||
* Error in CLI generated code for Yang empty types
|
||||
|
||||
### Major changes:
|
||||
* Added support for YANG anyxml.
|
||||
|
|
|
|||
|
|
@ -348,6 +348,12 @@ yang2cli_var(clicon_handle h,
|
|||
&options, &mincv, &maxcv, &pattern, &fraction_digits) < 0)
|
||||
goto done;
|
||||
restype = yrestype?yrestype->ys_argument:NULL;
|
||||
|
||||
if (restype && strcmp(restype, "empty") == 0){
|
||||
retval = 0;
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (clicon_type2cv(type, restype, &cvtype) < 0)
|
||||
goto done;
|
||||
|
||||
|
|
@ -389,7 +395,6 @@ yang2cli_var(clicon_handle h,
|
|||
cprintf(cb0, ")");
|
||||
}
|
||||
}
|
||||
|
||||
retval = 0;
|
||||
done:
|
||||
return retval;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ new "netconf get (should be some)"
|
|||
expecteof "$clixon_netconf -qf $clixon_cf -y /tmp/test.yang" "<rpc><get><filter type=\"xpath\" select=\"/\"/></get></rpc>]]>]]>" "^<rpc-reply><data><x><y><a>1</a><b>2</b><c>5</c></y><d/></x></data></rpc-reply>]]>]]>$"
|
||||
|
||||
new "cli set leaf-list"
|
||||
expectfn "$clixon_cli -D 1 -1f $clixon_cf -y /tmp/test.yang set x f e foo" ""
|
||||
expectfn "$clixon_cli -1f $clixon_cf -y /tmp/test.yang set x f e foo" ""
|
||||
|
||||
new "cli show leaf-list"
|
||||
expectfn "$clixon_cli -1f $clixon_cf -y /tmp/test.yang show xpath /x/f/e" "<e>foo</e>"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue