diff --git a/CHANGELOG.md b/CHANGELOG.md index 85528d81..8dab8fe4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -168,6 +168,9 @@ Users may have to change how they access the system ### Corrected Bugs +* Disabled xpath optimization for hierarchical list + * When `XPATH_LIST_OPTIMIZE` is set, patterns like `y[k='3']` is optimized + * But hierarchical lists should not be, ie when `a/y[k='3']` and `a` is a list * Fixed: [Validate error when appending module B grouping to module A item use augment statement #308](https://github.com/clicon/clixon/issues/308) * Fixed: [Restconf PATCH method request failed on item defined by submodule #306](https://github.com/clicon/clixon/issues/306) * Fixed: [restconf GET json response does not encode top level node with namespace as per rfc #303](https://github.com/clicon/clixon/issues/303) diff --git a/include/clixon_custom.h b/include/clixon_custom.h index 982ac984..6efa7c9d 100644 --- a/include/clixon_custom.h +++ b/include/clixon_custom.h @@ -59,9 +59,9 @@ #define IDENTITYREF_KLUDGE /*! Optimize special list key searches in XPATH finds - * Identify xpaths that search for exactly a list key, eg: "y[k=3]" and then call + * Identify xpaths that search for exactly a list key, eg: "y[k='3']" and then call * binary search. This only works if "y" has proper yang binding and is sorted by system - * Dont optimize on "hierarchical" lists such as: a/b/y[k=3], where a or b is another list. + * Dont optimize on "hierarchical" lists such as: a/y[k='3'], where a is another list. */ #define XPATH_LIST_OPTIMIZE diff --git a/lib/src/clixon_yang_module.c b/lib/src/clixon_yang_module.c index 358f5396..aa50c505 100644 --- a/lib/src/clixon_yang_module.c +++ b/lib/src/clixon_yang_module.c @@ -473,7 +473,9 @@ clixon_module_upgrade(clicon_handle h, } if (msd->md_status == 0) /* No modstate in startup */ goto ok; - /* Iterate through xml modified module state */ + /* Iterate through xml modified module state + * Note top-level here is typically module-set + */ xmod = NULL; while ((xmod = xml_child_each(msd->md_diff, xmod, CX_ELMNT)) != NULL) { /* Extract namespace */ diff --git a/test/test_netconf_notifications.sh b/test/test_netconf_notifications.sh index d01fbfaf..917c059c 100755 --- a/test/test_netconf_notifications.sh +++ b/test/test_netconf_notifications.sh @@ -34,7 +34,7 @@ cat < $cfg /usr/local/var/$APPNAME/$APPNAME.sock /usr/local/lib/$APPNAME/backend example_backend.so$ - $dir/restconf.pidfile + /usr/local/var/$APPNAME/$APPNAME.pidfile /usr/local/var/$APPNAME /usr/local/lib/$APPNAME/clispec /usr/local/lib/$APPNAME/cli diff --git a/test/test_pagination_config.sh b/test/test_pagination_config.sh index 482d7983..cf76ed69 100755 --- a/test/test_pagination_config.sh +++ b/test/test_pagination_config.sh @@ -36,7 +36,7 @@ cat < $cfg $dir /usr/local/var/$APPNAME/$APPNAME.sock /usr/local/lib/$APPNAME/backend - $dir/restconf.pidfile + /usr/local/var/$APPNAME/$APPNAME.pidfile $dir xml true diff --git a/test/test_pagination_draft.sh b/test/test_pagination_draft.sh index 3484815e..e612bfd3 100755 --- a/test/test_pagination_draft.sh +++ b/test/test_pagination_draft.sh @@ -31,7 +31,7 @@ cat < $cfg $dir /usr/local/var/$APPNAME/$APPNAME.sock /usr/local/lib/$APPNAME/backend - $dir/restconf.pidfile + /usr/local/var/$APPNAME/$APPNAME.pidfile $dir json true diff --git a/test/test_pagination_state.sh b/test/test_pagination_state.sh index 5a3a2f39..eac96699 100755 --- a/test/test_pagination_state.sh +++ b/test/test_pagination_state.sh @@ -39,7 +39,7 @@ cat < $cfg $dir /usr/local/var/$APPNAME/$APPNAME.sock /usr/local/lib/$APPNAME/backend - $dir/restconf.pidfile + /usr/local/var/$APPNAME/$APPNAME.pidfile $dir json true diff --git a/util/clixon_util_xpath.c b/util/clixon_util_xpath.c index ad2387d7..9327085f 100644 --- a/util/clixon_util_xpath.c +++ b/util/clixon_util_xpath.c @@ -301,7 +301,6 @@ main(int argc, cvec_print(stdout, nsc); goto ok; /* need a switch to continue, now just print and quit */ } - /* * If fp=stdin, then continue reading from stdin (after CR) * XXX Note 0 above, stdin here @@ -317,7 +316,7 @@ main(int argc, if ((ret = xml_bind_yang(x0, YB_MODULE, yspec, &xerr)) < 0) goto done; if (ret == 0){ - if ((cb = cbuf_new()) ==NULL){ + if ((cbret = cbuf_new()) ==NULL){ clicon_err(OE_XML, errno, "cbuf_new"); goto done; } diff --git a/yang/clixon/clixon-config@2022-03-21.yang b/yang/clixon/clixon-config@2022-03-21.yang index d518b8c9..c4d7af75 100644 --- a/yang/clixon/clixon-config@2022-03-21.yang +++ b/yang/clixon/clixon-config@2022-03-21.yang @@ -845,7 +845,7 @@ module clixon-config { type boolean; default false; description - "If set, tag datastores with RFC 7895 YANG Module Library + "If set, tag datastores with RFC 8525 YANG Module Library info. When loaded at startup, a check is made if the system yang modules match. See also CLICON_MODULE_LIBRARY_RFC7895";