* Add multiple yang support also for obsolete versions

* This means that files and datastores supporting modstate also looks for deleted or updated yang modules.
  * A stricter binding which gives error if loading outdated YANG file does not exist.
* Stricter yang checks: you cannot do get-config on datastores that have obsolete YANG
* Added xerr output parameter to `xmldb_get0()`
This commit is contained in:
Olof hagsand 2021-03-16 15:25:34 +01:00
parent d542cd5530
commit 8469a0962e
20 changed files with 328 additions and 118 deletions

View file

@ -1404,7 +1404,7 @@ yang_parse_post(clicon_handle h,
*/
int
yang_spec_parse_module(clicon_handle h,
const char *module,
const char *name,
const char *revision,
yang_stmt *yspec)
{
@ -1416,16 +1416,16 @@ yang_spec_parse_module(clicon_handle h,
clicon_err(OE_YANG, EINVAL, "yang spec is NULL");
goto done;
}
if (module == NULL){
if (name == NULL){
clicon_err(OE_YANG, EINVAL, "yang module not set");
goto done;
}
/* Apply steps 2.. on new modules, ie ones after modmin. */
modmin = yang_len_get(yspec);
/* Do not load module if it already exists */
if (yang_find(yspec, Y_MODULE, module) != NULL)
if (yang_find_module_by_name_revision(yspec, name, revision) != NULL)
goto ok;
if (yang_parse_module(h, module, revision, yspec) == NULL)
if (yang_parse_module(h, name, revision, yspec) == NULL)
goto done;
if (yang_parse_post(h, yspec, modmin) < 0)
goto done;