Fix a bind rpc assert on unknown namespace

This commit is contained in:
Olof hagsand 2020-04-23 11:06:25 +02:00
parent dc36282874
commit 476f1d84d3
5 changed files with 19 additions and 26 deletions

View file

@ -428,18 +428,12 @@ xml_bind_yang_rpc(cxobj *xrpc,
rpcname = xml_name(x);
if (ys_module_by_xml(yspec, x, &ymod) < 0)
goto done;
#if 1
assert(ymod);
#else
if (ymod == NULL){
if ((cberr = cbuf_new()) == NULL){
clicon_err(OE_UNIX, errno, "cbuf_new");
if (xerr &&
netconf_unknown_element_xml(xerr, "application", rpcname, "Unrecognized RPC (wrong namespace?)") < 0)
goto done;
}
/* more here */
goto fail;
}
#endif
if ((yrpc = yang_find(ymod, Y_RPC, rpcname)) == NULL){
if (xerr &&
netconf_unknown_element_xml(xerr, "application", rpcname, "Unrecognized RPC") < 0)