sort the XML before dumping when using -q switch
This commit is contained in:
parent
65733ffe69
commit
4aa0b745da
1 changed files with 19 additions and 1 deletions
|
|
@ -216,6 +216,24 @@ startup_common(clicon_handle h,
|
|||
}
|
||||
/* Print upgraded db: -q backend switch */
|
||||
if (clicon_quit_upgrade_get(h) == 1){
|
||||
/* bind yang */
|
||||
if (ret = (xml_bind_yang(xt, YB_MODULE, yspec, &xret) < 1)){
|
||||
if (ret == 0){
|
||||
/* invalid */
|
||||
clicon_err(OE_XML, EFAULT, "invalid configuration");
|
||||
}
|
||||
else {
|
||||
/* error */
|
||||
xml_print(stderr, xret);
|
||||
clicon_err(OE_XML, 0, "%s: YANG binding error", __func__);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
/* sort yang */
|
||||
if (xml_sort_recurse(xt) < 0) {
|
||||
clicon_err(OE_XML, EFAULT, "Yang sort error");
|
||||
exit(0);
|
||||
}
|
||||
if (xmldb_dump(h, stdout, xt) < 0)
|
||||
goto done;
|
||||
exit(0); /* This is fairly abrupt , but need to avoid side-effects of rewinding
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue