Fixed: [CLI bug w/ device domains on juniper qfx devices](https://github.com/clicon/clixon-controller/issues/145)

Reverted uses/grouping remove optimization
This commit is contained in:
Olof hagsand 2024-10-05 13:35:00 +02:00
parent f0f3ed0dff
commit 0c8aef0291
2 changed files with 0 additions and 34 deletions

View file

@ -57,7 +57,6 @@ int yang_file_find_match(clixon_handle h, const char *module, const char
yang_stmt *yang_parse_filename(clixon_handle h, const char *filename, yang_stmt *ysp);
yang_stmt *yang_parse_module(clixon_handle h, const char *module, const char *revision, yang_stmt *yspec, char *domain, char *origname);
int yang_parse_post(clixon_handle h, yang_stmt *yspec, int modmin);
int yang_parse_optimize_uses(clixon_handle h, yang_stmt *yspec);
int yang_spec_parse_module(clixon_handle h, const char *module,
const char *revision, yang_stmt *yspec);
yang_stmt *yang_parse_str(char *str, const char *name, yang_stmt *yspec);

View file

@ -1640,39 +1640,6 @@ yang_parse_post(clixon_handle h,
return retval;
}
/*! Optimize yang-stmt parse-tree by recursively removing USES stmt in derived trees
*
* @param[in] h Clixon handle
* @param[in] yspec Yang spec tree
* @retval 0 OK
* @retval -1 Error
* @note This must be done after yang_parse_post (and yang2cli calls if CLI).
*/
int
yang_parse_optimize_uses(clixon_handle h,
yang_stmt *yt)
{
int retval = -1;
yang_stmt *ys;
int i;
/* Dont increment due to prune in loop */
for (i=0; i<yang_len_get(yt); ){
ys = yang_child_i(yt, i);
if (yang_orig_get(ys) && yang_keyword_get(ys) == Y_USES){
ys_prune(yt, i);
ys_free(ys);
continue;
}
if (yang_parse_optimize_uses(h, ys) < 0)
goto done;
i++;
}
retval = 0;
done:
return retval;
}
/*! Parse yang specification and its dependencies recursively given module
*
* @param[in] h clicon handle