removed state path kludge

This commit is contained in:
Olof hagsand 2020-05-05 17:13:38 +02:00
parent bc0eb921d0
commit f9e1fe5de7
8 changed files with 24 additions and 70 deletions

View file

@ -727,28 +727,15 @@ clicon_rpc_get(clicon_handle h,
}
else{
yspec = clicon_dbspec_yang(h);
#ifdef USE_STATE_PATH_KLUDGE
{
char *kpath;
if (xpath &&
(kpath = clicon_option_str(h, "CLICON_STATE_PATH_KLUDGE")) != NULL &&
strncmp(xpath, kpath, strlen(kpath)) == 0){
}
else{
#endif /* USE_STATE_PATH_KLUDGE */
if ((ret = xml_bind_yang(xd, YB_MODULE, yspec, &xerr)) < 0)
goto done;
if (ret == 0){
assert(xerr != NULL);
if ((xd = xpath_first(xerr, NULL, "rpc-error")) == NULL){
clicon_err(OE_XML, ENOENT, "Expected rpc-error tag but none found(internal)");
goto done;
}
}
#ifdef USE_STATE_PATH_KLUDGE
if ((ret = xml_bind_yang(xd, YB_MODULE, yspec, &xerr)) < 0)
goto done;
if (ret == 0){
assert(xerr != NULL);
if ((xd = xpath_first(xerr, NULL, "rpc-error")) == NULL){
clicon_err(OE_XML, ENOENT, "Expected rpc-error tag but none found(internal)");
goto done;
}
}
#endif
}
if (xt){
if (xml_rm(xd) < 0)