* Prefix of rpc was ignored

* https://github.com/clicon/clixon/issues/30
This commit is contained in:
Olof hagsand 2018-06-20 20:53:34 +02:00
parent 578a96eff7
commit 60ce7b12bd
6 changed files with 39 additions and 17 deletions

View file

@ -2082,16 +2082,16 @@ schema_nodeid_vec(yang_node *yn,
* Assume schema nodeid:s have prefixes, (actually the first).
* @see yang_desc_schema_nodeid
* @see RFC7950 6.5
o schema node: A node in the schema tree. One of action, container,
leaf, leaf-list, list, choice, case, rpc, input, output,
notification, anydata, and anyxml.
* o schema node: A node in the schema tree. One of action, container,
* leaf, leaf-list, list, choice, case, rpc, input, output,
* notification, anydata, and anyxml.
* Used in yang: deviation, top-level augment
*/
int
yang_abs_schema_nodeid(yang_spec *yspec,
char *schema_nodeid,
yang_abs_schema_nodeid(yang_spec *yspec,
char *schema_nodeid,
enum rfc_6020 keyword,
yang_stmt **yres)
yang_stmt **yres)
{
int retval = -1;
char **vec = NULL;
@ -2136,7 +2136,6 @@ yang_abs_schema_nodeid(yang_spec *yspec,
}
}
if (ymod == NULL){ /* Try with topnode */
if ((ys = yang_find_topnode(yspec, id, YC_SCHEMANODE)) == NULL){
clicon_err(OE_YANG, 0, "Module with id:%s:%s not found", prefix,id);
goto done;
@ -2145,6 +2144,11 @@ yang_abs_schema_nodeid(yang_spec *yspec,
clicon_err(OE_YANG, 0, "Module with id:%s:%s not found2", prefix,id);
goto done;
}
if ((yprefix = yang_find((yang_node*)ymod, Y_PREFIX, NULL)) != NULL &&
strcmp(yprefix->ys_argument, prefix) != 0){
clicon_err(OE_YANG, 0, "Module with id:%s:%s not found", prefix,id);
goto done;
}
}
if (schema_nodeid_vec((yang_node*)ymod, vec+1, nvec-1, keyword, yres) < 0)
goto done;