* Added new startup-mode: running-startup: First try running db, if it is empty try startup db.

* See [Can startup mode to be extended to support running-startup mode? #234](https://github.com/clicon/clixon/issues/234)
* Improved error message on failed MUST condition
This commit is contained in:
Olof hagsand 2021-05-27 11:34:50 +02:00
parent 69af2884d0
commit e0c3f5467c
7 changed files with 34 additions and 10 deletions

View file

@ -1218,8 +1218,14 @@ xml_yang_validate_all(clicon_handle h,
goto done;
if (!nr){
ye = yang_find(yc, Y_ERROR_MESSAGE, NULL);
if ((cb = cbuf_new()) == NULL){
clicon_err(OE_UNIX, errno, "cbuf_new");
goto done;
}
cprintf(cb, "Failed MUST xpath '%s' of '%s' in module %s",
xpath, xml_name(xt), yang_argument_get(ys_module(ys)));
if (netconf_operation_failed_xml(xret, "application",
ye?yang_argument_get(ye):"must xpath validation failed") < 0)
ye?yang_argument_get(ye):cbuf_get(cb)) < 0)
goto done;
goto fail;
}

View file

@ -140,7 +140,7 @@ nodetest_eval_node(cxobj *x,
retval = 0; /* no match */
goto done;
}
/* here names are equal
/* Here names are equal
* Now look for namespaces
* 1) prefix1 and prefix2 point to same namespace <<-- try this first
* 2) prefix1 is equal to prefix2 <<-- then try this
@ -345,7 +345,8 @@ xp_eval_step(xp_ctx *xc0,
if (ret == 0){/* regular code, no optimization made */
while ((x = xml_child_each(xv, x, CX_ELMNT)) != NULL) {
/* xs->xs_c0 is nodetest */
if (nodetest == NULL || nodetest_eval(x, nodetest, nsc, localonly) == 1){
if (nodetest == NULL ||
nodetest_eval(x, nodetest, nsc, localonly) == 1){
if (cxvec_append(x, &vec, &veclen) < 0)
goto done;
}