aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2020-01-30 09:36:34 +0100
committerJake Hunsaker <jhunsake@redhat.com>2020-02-04 12:59:09 -0500
commit509dfd5b19be6bfad318dccc90ca12ab8e3a7ecb (patch)
treeef9431d9c2967fa6feb125cbc60a0af4694f7670
parentdd9c27b938e53f3962940472fffc4aa8350d9943 (diff)
downloadsos-509dfd5b19be6bfad318dccc90ca12ab8e3a7ecb.tar.gz
[plugins] add_service_status to support all kwargs
Currently, add_service_status allows just timeout and pred arguments. Let enhance it to support all arguments of _add_cmd_output / _collect_cmd_output. Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/__init__.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index 22d366a4..541e8822 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -1342,13 +1342,13 @@ class Plugin(object):
"""
self.custom_text += text
- def add_service_status(self, services, timeout=None, pred=None):
+ def add_service_status(self, services, **kwargs):
"""Collect service status information based on the InitSystem used.
:param services: A string, or list of strings, specifying the services
to collect
- :param timeout: Optional timeout in seconds
- :param pred: An optional predicate to gate collection
+ :param kwargs Optional arguments to pass to _add_cmd_output
+ (timeout, predicate, suggest_filename,..)
"""
if isinstance(services, six.string_types):
services = [services]
@@ -1361,8 +1361,7 @@ class Plugin(object):
return
for service in services:
- self._add_cmd_output(cmd="%s %s" % (query, service), pred=pred,
- timeout=timeout)
+ self._add_cmd_output(cmd="%s %s" % (query, service), **kwargs)
def add_journal(self, units=None, boot=None, since=None, until=None,
lines=None, allfields=False, output=None, timeout=None,