* Added yang population of data in clicon_rpc_get[_config]
This commit is contained in:
parent
2de8497972
commit
bab3b5ad56
6 changed files with 114 additions and 62 deletions
|
|
@ -433,7 +433,6 @@ cli_show_config1(clicon_handle h,
|
|||
cvec *argv)
|
||||
{
|
||||
int retval = -1;
|
||||
int ret;
|
||||
char *db;
|
||||
char *formatstr;
|
||||
char *xpath;
|
||||
|
|
@ -496,13 +495,6 @@ cli_show_config1(clicon_handle h,
|
|||
clicon_rpc_generate_error(xerr, "Get configuration", NULL);
|
||||
goto done;
|
||||
}
|
||||
/* Some formats (eg cli) require yang */
|
||||
if ((ret = xml_spec_populate(xt, yspec, &xerr)) < 0)
|
||||
goto done;
|
||||
if (ret == 0){
|
||||
clicon_rpc_generate_error(xerr, "Get configuration", NULL);
|
||||
goto done;
|
||||
}
|
||||
/* Print configuration according to format */
|
||||
switch (format){
|
||||
case FORMAT_XML:
|
||||
|
|
@ -688,7 +680,6 @@ cli_show_auto1(clicon_handle h,
|
|||
cvec *argv)
|
||||
{
|
||||
int retval = 1;
|
||||
int ret;
|
||||
yang_stmt *yspec;
|
||||
char *api_path_fmt; /* xml key format */
|
||||
// char *api_path = NULL; /* xml key */
|
||||
|
|
@ -743,18 +734,10 @@ cli_show_auto1(clicon_handle h,
|
|||
if (clicon_rpc_get(h, xpath, nsc, CONTENT_ALL, -1, &xt) < 0)
|
||||
goto done;
|
||||
}
|
||||
|
||||
if ((xerr = xpath_first(xt, NULL, "/rpc-error")) != NULL){
|
||||
clicon_rpc_generate_error(xerr, "Get configuration", NULL);
|
||||
goto done;
|
||||
}
|
||||
/* Some formats (eg cli) require yang */
|
||||
if ((ret = xml_spec_populate(xt, yspec, &xerr)) < 0)
|
||||
goto done;
|
||||
if (ret == 0){
|
||||
clicon_rpc_generate_error(xerr, "Get configuration", NULL);
|
||||
goto done;
|
||||
}
|
||||
if ((xp = xpath_first(xt, nsc, "%s", xpath)) != NULL)
|
||||
/* Print configuration according to format */
|
||||
switch (format){
|
||||
|
|
|
|||
|
|
@ -204,8 +204,6 @@ api_data_get2(clicon_handle h,
|
|||
goto done;
|
||||
goto ok;
|
||||
}
|
||||
if (xml_spec_populate(xret, yspec, NULL) < 0)
|
||||
goto done;
|
||||
/* We get return via netconf which is complete tree from root
|
||||
* We need to cut that tree to only the object.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue