File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66#
77# See the LICENSE file in the source distribution for further information.
88
9- from sos .report .plugins import Plugin , IndependentPlugin
9+ from sos .report .plugins import Plugin , IndependentPlugin , SoSPredicate
1010
1111
1212class Block (Plugin , IndependentPlugin ):
@@ -70,7 +70,15 @@ def setup(self):
7070 dev = line .split ()[0 ]
7171 self .add_cmd_output (f'cryptsetup luksDump /dev/{ dev } ' )
7272 self .add_cmd_output (f'clevis luks list -d /dev/{ dev } ' )
73-
73+ # cryptsetup status needs the device-mapper
74+ # table name for the crypt target
75+ luks_map = self .collect_cmd_output ("dmsetup table --target crypt" ,
76+ pred = SoSPredicate (self ,
77+ kmods = ['dm_mod' ]))
78+ if luks_map ['status' ] == 0 :
79+ for line in luks_map ['output' ].splitlines ():
80+ dev = line .split (':' )[0 ]
81+ self .add_cmd_output (f'cryptsetup status /dev/mapper/{ dev } ' )
7482 self .add_copy_spec ("/etc/crypttab" )
7583
7684# vim: set et ts=4 sw=4 :
You can’t perform that action at this time.
0 commit comments