Add proper error message if namespace not found in module-set header

This commit is contained in:
Olof hagsand 2022-11-28 13:50:41 +01:00
parent 7a388b960a
commit 8ebab16c4c
4 changed files with 9 additions and 4 deletions

View file

@ -424,8 +424,10 @@ mod_ns_upgrade(clicon_handle h,
/* If modified or added get to revision from system */
if (xml_flag(xmod, (XML_FLAG_CHANGE|XML_FLAG_ADD)) != 0x0){
yspec = clicon_dbspec_yang(h);
if ((ymod = yang_find_module_by_namespace(yspec, ns)) == NULL)
if ((ymod = yang_find_module_by_namespace(yspec, ns)) == NULL){
cprintf(cbret, "Module-set upgrade header contains namespace %s, but is not found in running system", ns);
goto fail;
}
if ((yrev = yang_find(ymod, Y_REVISION, NULL)) == NULL){
retval = 1;
goto done;