Added warning if modstate is not present in datastore if is set

This commit is contained in:
Olof hagsand 2022-10-03 10:29:28 +02:00
parent bae92488e9
commit f0c8201762
2 changed files with 9 additions and 0 deletions

View file

@ -54,6 +54,10 @@ Developers may need to change their code
* C API changes * C API changes
* Added `defaults` parameter to `clicon_rpc_get_pageable_list()` * Added `defaults` parameter to `clicon_rpc_get_pageable_list()`
### Minor features
* Added warning if modstate is not present in datastore if `CLICON_XMLDB_MODSTATE` is set.
### Corrected Bugs ### Corrected Bugs
* Fixed: [message-id present on netconf app "hello"](https://github.com/clicon/clixon/issues/369) * Fixed: [message-id present on netconf app "hello"](https://github.com/clicon/clixon/issues/369)

View file

@ -200,6 +200,11 @@ startup_common(clicon_handle h,
if (xmldb_get0(h, db, YB_NONE, NULL, "/", 0, &xt, msdiff, &xerr) < 0) if (xmldb_get0(h, db, YB_NONE, NULL, "/", 0, &xt, msdiff, &xerr) < 0)
goto done; goto done;
} }
if (msdiff && msdiff->md_status == 0){ // Possibly check for CLICON_XMLDB_MODSTATE
clicon_log(LOG_WARNING, "Modstate expected in startup datastore but not found\n"
"This may indicate that the datastore is not initialized corrrectly, such as copy/pasted.\n"
"It may also be normal bootstrapping since module state will be written on next datastore save");
}
if ((yspec = clicon_dbspec_yang(h)) == NULL){ if ((yspec = clicon_dbspec_yang(h)) == NULL){
clicon_err(OE_YANG, 0, "Yang spec not set"); clicon_err(OE_YANG, 0, "Yang spec not set");
goto done; goto done;