Fixed [Wrong yang-generated cli code for typeref identityref combination #88](https://github.com/clicon/clixon/issues/88)
This commit is contained in:
parent
fe35e181fd
commit
d12644a5ef
3 changed files with 21 additions and 4 deletions
|
|
@ -251,6 +251,7 @@
|
|||
|
||||
### Corrected Bugs
|
||||
|
||||
* Fixed [Wrong yang-generated cli code for typeref identityref combination #88](https://github.com/clicon/clixon/issues/88)
|
||||
* Fixed [identityref validation fails when using typedef #87](https://github.com/clicon/clixon/issues/87)
|
||||
* Fixed a problem with some netconf error messages caused restconf daemon to exit due to no XML encoding
|
||||
* Check cligen tab mode, dont start if CLICON_CLI_TAB_MODE is undefined
|
||||
|
|
|
|||
|
|
@ -185,14 +185,15 @@ yang2cli_var_identityref(yang_stmt *ys,
|
|||
char *name;
|
||||
char *id;
|
||||
int i;
|
||||
int len;
|
||||
|
||||
/* Add a wildchar string first -let validate take it for default prefix */
|
||||
cprintf(cb, ">");
|
||||
if (helptext)
|
||||
cprintf(cb, "(\"%s\")", helptext);
|
||||
if ((ybaseref = yang_find(ytype, Y_BASE, NULL)) != NULL &&
|
||||
(ybaseid = yang_find_identity(ys, yang_argument_get(ybaseref))) != NULL){
|
||||
if (cvec_len(yang_cvec_get(ybaseid)) > 0){
|
||||
/* Add a wildchar string first -let validate take it for default prefix */
|
||||
cprintf(cb, ">");
|
||||
if (helptext)
|
||||
cprintf(cb, "(\"%s\")", helptext);
|
||||
cprintf(cb, "|<%s:%s choice:", yang_argument_get(ys), cvtypestr);
|
||||
i = 0;
|
||||
while ((cv = cvec_each(yang_cvec_get(ybaseid), cv)) != NULL){
|
||||
|
|
|
|||
|
|
@ -130,6 +130,12 @@ cat <<EOF > $fyang
|
|||
}
|
||||
}
|
||||
}
|
||||
identity empty; /* some errors with an empty identity set */
|
||||
leaf e {
|
||||
type identityref {
|
||||
base mc:empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
|
|
@ -237,6 +243,15 @@ expectfn "$clixon_cli -1 -f $cfg -l o set acls acl x type undefined" 0 "^$"
|
|||
new "cli validate"
|
||||
expectfn "$clixon_cli -1 -f $cfg -l o validate" 255 "Identityref validation failed"
|
||||
|
||||
# test empty identityref list
|
||||
new "cli set empty"
|
||||
expectfn "$clixon_cli -1 -f $cfg -l o set e undefined" 0 "^$"
|
||||
|
||||
new "cli validate"
|
||||
expectfn "$clixon_cli -1 -f $cfg -l o validate" 255 "Identityref validation failed"
|
||||
|
||||
new "netconf discard-changes"
|
||||
expecteof "$clixon_netconf -qf $cfg" 0 "<rpc><discard-changes/></rpc>]]>]]>" "^<rpc-reply><ok/></rpc-reply>]]>]]>$"
|
||||
|
||||
if [ $BE -eq 0 ]; then
|
||||
exit # BE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue