* 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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue