# SPDX-License-Identifier: LGPL-2.1-or-laterimport jsonfrom tracer.query import Queryq = Query()applications = q.affected_applications().get()def filter_by_type(apps, type_str):return [app.name for app in apps if app.type == type_str]dump_obj = {}# ignore type "session" for cockpit use casedump_obj["reboot"] = filter_by_type(applications, "static")dump_obj["daemons"] = filter_by_type(applications, "daemon")dump_obj["manual"] = filter_by_type(applications, "application")print(json.dumps(dump_obj))