aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2018-09-05 12:34:48 +0200
committerBryn M. Reeves <bmr@redhat.com>2018-12-12 10:07:49 +0000
commit0ba743bbf9df335dd47ec45a450e63d72d7ce494 (patch)
treedf9fec9007dc66588fd05ae6807f58f9e93a2dec
parent254d93499d64acaff5103e15c25649d418004737 (diff)
downloadsos-0ba743bbf9df335dd47ec45a450e63d72d7ce494.tar.gz
[plugins] fix 6db459e for SCL services
Calling _files_pkgs_or_cmds_present for SCLs lacks "services" argument that was added in 6db459e commit. Also it is worth renaming the method to more generic _check_plugin_triggers . Resolves: #1416 Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/__init__.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index 97f3cc59..3abe29db 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -1033,16 +1033,18 @@ class Plugin(object):
files = [f % {"scl_name": scl} for f in self.files]
packages = [p % {"scl_name": scl} for p in self.packages]
commands = [c % {"scl_name": scl} for c in self.commands]
- if self._files_pkgs_or_cmds_present(files,
- packages,
- commands):
+ services = [s % {"scl_name": scl} for s in self.services]
+ if self._check_plugin_triggers(files,
+ packages,
+ commands,
+ services):
type(self)._scls_matched.append(scl)
return len(type(self)._scls_matched) > 0
- return self._files_pkgs_or_cmds_present(self.files,
- self.packages,
- self.commands,
- self.services)
+ return self._check_plugin_triggers(self.files,
+ self.packages,
+ self.commands,
+ self.services)
if isinstance(self, SCLPlugin):
# if files and packages weren't specified, we take all SCLs
@@ -1050,7 +1052,7 @@ class Plugin(object):
return True
- def _files_pkgs_or_cmds_present(self, files, packages, commands, services):
+ def _check_plugin_triggers(self, files, packages, commands, services):
kernel_mods = self.policy.lsmod()
def have_kmod(kmod):