Fixed: Yang xpath statements containing prefixes stopped working due to namespace context updates
This commit is contained in:
parent
e8ae628d06
commit
6384fb89f1
4 changed files with 20 additions and 5 deletions
|
|
@ -1,5 +1,10 @@
|
|||
# Clixon Changelog
|
||||
|
||||
## 4.3.1 (Expected: January 2020)
|
||||
|
||||
### Corrected Bugs
|
||||
* Fixed: Yang `must` xpath statements containing prefixes stopped working due to namespace context updates
|
||||
|
||||
## 4.3.0 (1 January 2020)
|
||||
|
||||
There were several issues with multiple namespaces with augmented yangs in 4.2 that have been fixed in 4.3. Some other highlights include: several issues with XPaths including "canonical namespace context" support, a reorganization of the YANG files shipped with the release, and a wildchar in the CLICON_MODE variable.
|
||||
|
|
@ -12,6 +17,7 @@ There were several issues with multiple namespaces with augmented yangs in 4.2 t
|
|||
* Optional yang files can be installed in a separate dir with `--with-opt-yang-installdir=DIR` (renamed from `with-std-yang-installdir`)
|
||||
* C-API
|
||||
* Changed `clicon_rpc_generate_error(msg, xerr)` to `clicon_rpc_generate_error(xerr, msg, arg)`
|
||||
* If you pass NULL as arg it produces the same message as before.
|
||||
* Added namespace-context parameter `nsc` to `xpath_first` and `xpath_vec`, (`xpath_vec_nsc` and
|
||||
xpath_first_nsc` are removed).
|
||||
* Added clicon_handle as parameter to all `clicon_connect_` functions to get better error message
|
||||
|
|
|
|||
4
configure
vendored
4
configure
vendored
|
|
@ -2173,8 +2173,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
|||
|
||||
CLIXON_VERSION_MAJOR="4"
|
||||
CLIXON_VERSION_MINOR="3"
|
||||
CLIXON_VERSION_PATCH="0"
|
||||
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
|
||||
CLIXON_VERSION_PATCH="1"
|
||||
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}.PRE\""
|
||||
|
||||
# Check CLIgen
|
||||
if test "$prefix" = "NONE"; then
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ AC_INIT(lib/clixon/clixon.h.in)
|
|||
|
||||
CLIXON_VERSION_MAJOR="4"
|
||||
CLIXON_VERSION_MINOR="3"
|
||||
CLIXON_VERSION_PATCH="0"
|
||||
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}\""
|
||||
CLIXON_VERSION_PATCH="1"
|
||||
CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}.PRE\""
|
||||
|
||||
# Check CLIgen
|
||||
if test "$prefix" = "NONE"; then
|
||||
|
|
|
|||
|
|
@ -1064,6 +1064,7 @@ xml_yang_validate_all(clicon_handle h,
|
|||
cxobj *x;
|
||||
char *namespace = NULL;
|
||||
cbuf *cb = NULL;
|
||||
cvec *nsc = NULL;
|
||||
|
||||
/* if not given by argument (overide) use default link
|
||||
and !Node has a config sub-statement and it is false */
|
||||
|
|
@ -1124,7 +1125,9 @@ xml_yang_validate_all(clicon_handle h,
|
|||
if (yang_keyword_get(yc) != Y_MUST)
|
||||
continue;
|
||||
xpath = yang_argument_get(yc); /* "must" has xpath argument */
|
||||
if ((nr = xpath_vec_bool(xt, NULL, "%s", xpath)) < 0)
|
||||
if (xml_nsctx_yang(yc, &nsc) < 0)
|
||||
goto done;
|
||||
if ((nr = xpath_vec_bool(xt, nsc, "%s", xpath)) < 0)
|
||||
goto done;
|
||||
if (!nr){
|
||||
ye = yang_find(yc, Y_ERROR_MESSAGE, NULL);
|
||||
|
|
@ -1133,6 +1136,10 @@ xml_yang_validate_all(clicon_handle h,
|
|||
goto done;
|
||||
goto fail;
|
||||
}
|
||||
if (nsc){
|
||||
xml_nsctx_free(nsc);
|
||||
nsc = NULL;
|
||||
}
|
||||
}
|
||||
/* "when" sub-node RFC 7950 Sec 7.21.5. Can only be one. */
|
||||
if ((yc = yang_find(ys, Y_WHEN, NULL)) != NULL){
|
||||
|
|
@ -1165,6 +1172,8 @@ xml_yang_validate_all(clicon_handle h,
|
|||
ok:
|
||||
retval = 1;
|
||||
done:
|
||||
if (nsc)
|
||||
xml_nsctx_free(nsc);
|
||||
if (cb)
|
||||
cbuf_free(cb);
|
||||
return retval;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue