From 03b61f7050bdc0885062f29b6628800519e7abbd Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Wed, 24 Apr 2024 10:08:12 +0200 Subject: [PATCH] [flatpak] Predicate two cmds by gvfs service Two commands "flatpak --installations" and "flatpak --print-updated-env" can enable user's gvfs-daemon.service even with GVFS_REMOTE_VOLUME_MONITOR_IGNORE=1 set, so let put them under a predicate. Resolves: #3618 Relevant: RHEL-14328 Signed-off-by: Pavel Moravec --- sos/report/plugins/flatpak.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sos/report/plugins/flatpak.py b/sos/report/plugins/flatpak.py index 7aeb8cecbd..75cfd13880 100644 --- a/sos/report/plugins/flatpak.py +++ b/sos/report/plugins/flatpak.py @@ -6,7 +6,7 @@ # # See the LICENSE file in the source distribution for further information. -from sos.report.plugins import Plugin, IndependentPlugin +from sos.report.plugins import Plugin, IndependentPlugin, SoSPredicate class Flatpak(Plugin, IndependentPlugin): @@ -20,19 +20,27 @@ class Flatpak(Plugin, IndependentPlugin): def setup(self): env = {"GVFS_REMOTE_VOLUME_MONITOR_IGNORE": "1"} + gvfs_pred = SoSPredicate( + self, cmd_outputs={ + 'cmd': 'systemctl --user status gvfs-daemon.service', + 'output': '(running)' + } + ) self.add_cmd_output([ "flatpak --version", "flatpak --default-arch", "flatpak --supported-arches", "flatpak --gl-drivers", - "flatpak --installations", - "flatpak --print-updated-env", "flatpak config", "flatpak remote-list --show-details", "flatpak list --runtime --show-details", "flatpak list --app --show-details", "flatpak history --columns=all", ], env=env) + self.add_cmd_output([ + "flatpak --installations", + "flatpak --print-updated-env", + ], env=env, pred=gvfs_pred) if self.get_option("verify"): self.add_cmd_output("flatpak repair --dry-run", env=env)