Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def __parse_args(desc: str) -> object:

def __normalize_json(json_data: dict[str, any], remove_empty: bool = True, remove_none: bool = True) -> dict[str, any]:
"""Sorts a JSON file and optionally remove empty and none values"""
SORT_FIELDS = {"users": "login"}
SORT_FIELDS = {"users": "login", "groups": "name"}
log.info("Normalizing JSON - remove empty = %s, remove nones = %s", str(remove_empty), str(remove_none))
json_data = utilities.clean_data(json_data, remove_none=remove_none, remove_empty=remove_empty)
json_data = utilities.order_keys(json_data, *_SECTIONS_ORDER)
Expand Down
4 changes: 2 additions & 2 deletions sonar/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,11 @@ def export(endpoint: pf.Platform, export_settings: types.ConfigSettings, **kwarg
"""

log.info("Exporting groups")
g_list = {}
g_list = []
for g_name, g_obj in get_list(endpoint=endpoint).items():
if not export_settings.get("FULL_EXPORT", False) and g_obj.is_default():
continue
g_list[g_name] = "" if g_obj.description is None else g_obj.description
g_list.append({"name": g_name, "description": g_obj.description or ""})
log.info("%s groups to export", len(g_list))
if write_q := kwargs.get("write_q", None):
write_q.put(g_list)
Expand Down