remove containers holding only default values

This commit is contained in:
Jan-Olof Carlson 2022-09-08 17:22:06 +00:00 committed by Olof hagsand
parent 38f501be19
commit 42d5b6fba2
2 changed files with 36 additions and 6 deletions

View file

@ -498,10 +498,12 @@ with_defaults(cxobj *xe,
/* Mark state nodes */
if (xml_non_config_data(xret, NULL) < 0)
goto done;
/* Remove default configuration nodes*/
/* Remove default configuration nodes */
if (xml_tree_prune_flags(xret, XML_FLAG_DEFAULT, XML_FLAG_MARK | XML_FLAG_DEFAULT) < 0)
goto done;
/* TODO. Remove empty containers */
/* Remove empty containers */
if (xml_defaults_nopresence(xret, 1) < 0)
goto done;
goto ok;
}
if (strcmp(mode, "trim") == 0) {
@ -514,7 +516,9 @@ with_defaults(cxobj *xe,
if (xml_tree_prune_flags(xret, XML_FLAG_MARK, XML_FLAG_MARK)
< 0)
goto done;
/* TODO. Remove empty containers */
/* Remove empty containers */
if (xml_defaults_nopresence(xret, 1) < 0)
goto done;
goto ok;
}
if (strcmp(mode, "report-all-tagged") == 0) {