Three errors in new upgrade code: DEL didnt work, empty config did now work, neither did no yang files in a dir

This commit is contained in:
Olof hagsand 2020-06-27 13:02:04 +02:00
parent 8f1de15ad3
commit c2e459e8bb
5 changed files with 329 additions and 15 deletions

View file

@ -417,7 +417,7 @@ mod_ns_upgrade(clicon_handle h,
goto done;
}
if ((ret = upgrade_callback_call(h, xt, ns,
xml_flag(xmod, (XML_FLAG_CHANGE|XML_FLAG_ADD|XML_FLAG_CHANGE)),
xml_flag(xmod, (XML_FLAG_ADD|XML_FLAG_DEL|XML_FLAG_CHANGE)),
from, to, cbret)) < 0)
goto done;
if (ret == 0) /* XXX ignore and continue? */

View file

@ -1208,8 +1208,7 @@ yang_spec_load_dir(clicon_handle h,
if((ndp = clicon_file_dirent(dir, &dp, "(.yang)$", S_IFREG)) < 0)
goto done;
if (ndp == 0)
clicon_log(LOG_WARNING, "%s: No yang files found in %s",
__FUNCTION__, dir);
goto ok;
/* Apply post steps on new modules, ie ones after modnr. */
modnr = yang_len_get(yspec);
/* Load all yang files in dir */
@ -1270,6 +1269,7 @@ yang_spec_load_dir(clicon_handle h,
}
if (yang_parse_post(h, yspec, modnr) < 0)
goto done;
ok:
retval = 0;
done:
if (dp)