add state-path kludge to cligen frontend bind statement as well

This commit is contained in:
Olof hagsand 2020-05-02 10:37:02 +02:00
parent 08c4a424ca
commit b4c591a985
2 changed files with 14 additions and 1 deletions

View file

@ -727,8 +727,21 @@ 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){
if (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;
#ifdef USE_STATE_PATH_KLUDGE
}
#endif
if (ret == 0){
if ((xd = xpath_first(xerr, NULL, "rpc-error")) == NULL){
clicon_err(OE_XML, ENOENT, "Expected rpc-error tag but none found(internal)");

View file

@ -726,7 +726,7 @@ module clixon-config {
"For get state commands, if the select xpath is equal (or its beginning)
is equal to the path in this option, then yang binding, sorting, default
values is skipped.
Note you need to set USE_STATE_PATH_KLUDGE compile option to use this.
Note you need to set USE_STATE_PATH_KLUDGE compile option
This is a temporary option which will go away in future releases, therefore
marked as obsolete.";
}