aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/sssd.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/sos/plugins/sssd.py b/sos/plugins/sssd.py
index d2c9613f..ea9fdeea 100644
--- a/sos/plugins/sssd.py
+++ b/sos/plugins/sssd.py
@@ -8,7 +8,8 @@
#
# See the LICENSE file in the source distribution for further information.
-from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
+from sos.plugins import (Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin,
+ SoSPredicate)
class Sssd(Plugin):
@@ -28,9 +29,14 @@ class Sssd(Plugin):
"/etc/sssd/conf.d/*.conf"
])
- self.add_cmd_output("sssctl config-check")
+ # call sssctl commands only when sssd service is running,
+ # otherwise the command timeouts
+ sssd_pred = SoSPredicate(self, services=["sssd"])
+ self.add_cmd_output("sssctl config-check", pred=sssd_pred)
- domain = self.collect_cmd_output("sssctl domain-list")
+ # if predicate fails, domain["status"] = None and thus we skip parsing
+ # missing output
+ domain = self.collect_cmd_output("sssctl domain-list", pred=sssd_pred)
if domain['status'] == 0:
for domain_name in domain['output'].splitlines():
self.add_cmd_output("sssctl domain-status -o " + domain_name)