renamed xml_spec_populate*() to xml_bind_yang*()

This commit is contained in:
Olof hagsand 2020-03-17 15:55:47 +01:00
parent c5e2039cac
commit b726c5008e
17 changed files with 191 additions and 185 deletions

View file

@ -670,7 +670,7 @@ from_client_edit_config(clicon_handle h,
xml_spec_set(xc, NULL);
/* Populate XML with Yang spec (why not do this in parser?)
*/
if (xml_spec_populate(xc, yspec, NULL) < 0)
if (xml_bind_yang(xc, yspec, NULL) < 0)
goto done;
/* Maybe validate xml here as in text_modify_top? */
if (xml_apply(xc, CX_ELMNT, xml_non_config_data, &non_config) < 0)
@ -1593,7 +1593,7 @@ from_client_msg(clicon_handle h,
* should really have been dealt with by decode above
* but it still is needed - test_cli debug test fails
*/
if (xml_spec_populate_rpc(x, yspec, NULL) < 0)
if (xml_bind_yang_rpc(x, yspec, NULL) < 0)
goto done;
if ((ret = xml_yang_validate_rpc(h, x, &xret)) < 0)
goto done;

View file

@ -214,7 +214,7 @@ startup_common(clicon_handle h,
goto done;
}
/* After upgrading, XML tree needs to be sorted and yang spec populated */
if (xml_spec_populate(xt, yspec, NULL) < 0)
if (xml_bind_yang(xt, yspec, NULL) < 0)
goto done;
if (xml_apply0(xt, CX_ELMNT, xml_sort, h) < 0)
goto done;

View file

@ -128,7 +128,7 @@ clixon_plugin_statedata(clicon_handle h,
if (debug)
clicon_log_xml(LOG_DEBUG, x, "%s STATE:", __FUNCTION__);
#endif
if (xml_spec_populate(x, yspec, NULL) < 0)
if (xml_bind_yang(x, yspec, NULL) < 0)
goto done;
if ((ret = netconf_trymerge(x, yspec, xret)) < 0)
goto done;

View file

@ -148,7 +148,7 @@ netconf_input_packet(clicon_handle h,
free(str0);
if ((xrpc=xpath_first(xreq, NULL, "//rpc")) != NULL){
isrpc++;
if (xml_spec_populate_rpc(xrpc, yspec, NULL) < 0)
if (xml_bind_yang_rpc(xrpc, yspec, NULL) < 0)
goto done;
if ((ret = xml_yang_validate_rpc(h, xrpc, &xret)) < 0)
goto done;

View file

@ -586,8 +586,8 @@ netconf_application_rpc(clicon_handle h,
if (yrpc != NULL){
/* 1. Check xn arguments with input statement. */
if ((yinput = yang_find(yrpc, Y_INPUT, NULL)) != NULL){
xml_spec_set(xn, yinput); /* needed for xml_spec_populate */
if (xml_spec_populate(xn, yspec, NULL) < 0)
xml_spec_set(xn, yinput); /* needed for xml_bind_yang */
if (xml_bind_yang(xn, yspec, NULL) < 0)
goto done;
if ((ret = xml_yang_validate_all_top(h, xn, &xerr)) < 0)
goto done;
@ -618,8 +618,8 @@ netconf_application_rpc(clicon_handle h,
if (0)
if ((youtput = yang_find(yrpc, Y_OUTPUT, NULL)) != NULL){
xoutput=xpath_first(*xret, NULL, "/");
xml_spec_set(xoutput, youtput); /* needed for xml_spec_populate */
if (xml_spec_populate(xoutput, yspec, NULL) < 0)
xml_spec_set(xoutput, youtput); /* needed for xml_bind_yang */
if (xml_bind_yang(xoutput, yspec, NULL) < 0)
goto done;
if ((ret = xml_yang_validate_all_top(h, xoutput, &xerr)) < 0)
goto done;

View file

@ -609,9 +609,9 @@ api_operations_post_output(clicon_handle h,
* (2) Uncertain how validation errors should be logged/handled
*/
if (youtput != NULL){
xml_spec_set(xoutput, youtput); /* needed for xml_spec_populate */
xml_spec_set(xoutput, youtput); /* needed for xml_bind_yang */
#if 0
if (xml_spec_populate(xoutput, yspec, NULL) < 0)
if (xml_bind_yang(xoutput, yspec, NULL) < 0)
goto done;
if ((ret = xml_yang_validate_all(xoutput, &xerr)) < 0)
goto done;
@ -832,7 +832,7 @@ api_operations_post(clicon_handle h,
clicon_log_xml(LOG_DEBUG, xtop, "%s 5. Translate input args:", __FUNCTION__);
#endif
/* 6. Validate outgoing RPC and fill in defaults */
if (xml_spec_populate_rpc(xtop, yspec, NULL) < 0) /* */
if (xml_bind_yang_rpc(xtop, yspec, NULL) < 0) /* */
goto done;
if ((ret = xml_yang_validate_rpc(h, xtop, &xret)) < 0)
goto done;