aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2021-04-19 12:03:54 -0400
committerJake Hunsaker <jhunsake@redhat.com>2021-05-05 09:54:51 -0400
commit23865e5334d2cd848a8855551e15b20cd12dc3ea (patch)
tree6ac1014b77d867bc28c0f766fd453e7bb802a390
parent5645cf760a5fa6a9f8d95fe2a2a23a7f4a17226a (diff)
downloadsos-23865e5334d2cd848a8855551e15b20cd12dc3ea.tar.gz
[grub2] Add predicate on dm_mod for grub2-mkconfig
The `grub2-mkconfig` command will load the `dm_mod` module if it is not already loaded. As such, add a predicate to skip command execution if that module is not loaded already. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/report/plugins/grub2.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sos/report/plugins/grub2.py b/sos/report/plugins/grub2.py
index 3baa3274..516912ba 100644
--- a/sos/report/plugins/grub2.py
+++ b/sos/report/plugins/grub2.py
@@ -39,7 +39,8 @@ class Grub2(Plugin, IndependentPlugin):
co = {'cmd': '%s --help' % grub_cmd, 'output': '--no-grubenv-update'}
if self.test_predicate(self, pred=SoSPredicate(self, cmd_outputs=co)):
grub_cmd += ' --no-grubenv-update'
- self.add_cmd_output(grub_cmd, env={'GRUB_DISABLE_OS_PROBER': 'true'})
+ self.add_cmd_output(grub_cmd, env={'GRUB_DISABLE_OS_PROBER': 'true'},
+ pred=SoSPredicate(self, kmods=['dm_mod']))
def postproc(self):
# the trailing space is required; python treats '_' as whitespace