Refactoring of dunplication detect

This commit is contained in:
Olof hagsand 2024-12-26 11:42:28 +01:00
parent 06e1a48480
commit 0c284f0594
3 changed files with 155 additions and 318 deletions

View file

@ -667,17 +667,17 @@ from_client_edit_config(clixon_handle h,
goto done;
/* Disable duplicate check in NETCONF messages. */
if (clicon_option_bool(h, "CLICON_NETCONF_DUPLICATE_ALLOW")){
if (xml_duplicate_remove_recurse(xc) < 0)
if ((ret = xml_duplicate_detect(xc, 1, NULL)) < 0)
goto done;
}
else {
if ((ret = xml_yang_validate_unique_recurse(xc, &xret)) < 0)
if ((ret = xml_duplicate_detect(xc, 0, &xret)) < 0)
goto done;
if (ret == 0){
if (clixon_xml2cbuf(cbret, xret, 0, 0, NULL, -1, 0) < 0)
goto done;
goto ok;
}
}
if (ret == 0){
if (clixon_xml2cbuf(cbret, xret, 0, 0, NULL, -1, 0) < 0)
goto done;
goto ok;
}
/* xmldb_put (difflist handling) requires list keys */
if ((ret = xml_yang_validate_list_key_only(xc, &xret)) < 0)