luksmeta - command luksmeta show -d <device_name>

This class provides parsing for the output of luksmeta <device_name>.

class insights.parsers.luksmeta.KeyslotSpecification(index, state, metadata)[source]

Bases: object

Class KeyslotSpecification describes information about a keyslot collected by the luksmeta show command.


the index of the described keyslot


the state of the described keyslot


the UUID of the application that stored metadata into the described keyslot

class insights.parsers.luksmeta.LuksMeta(context)[source]

Bases: insights.core.CommandParser, dict

Class LuksMeta parses the output of the luksmeta show -d <device> command.

This command prints information if the device has custom user-defined metadata embedded in the keyslots (used e.g. by clevis). If the device was not initialized using luksmeta, the parser raises SkipComponent.

The parser can be indexed by the keyslot index (in the range 0-7). A KeyslotSpecification object is returned, which describes every LUKS keyslot. The KeyslotSpecification contains the index, state and metadata fileds. Metadata field stores the UUID of the application that has stored metadata in the keyslot.

Sample input data is in the format:

0   active empty
1   active cb6e8904-81ff-40da-a84a-07ab9ab5715e
2   active empty
3   active empty
4 inactive empty
5   active empty
6   active cb6e8904-81ff-40da-a84a-07ab9ab5715e
7   active cb6e8904-81ff-40da-a84a-07ab9ab5715e


>>> type(parsed_result)
<class 'insights.parsers.luksmeta.LuksMeta'>
>>> parsed_result[0].index
>>> parsed_result[0].state
>>> parsed_result[4].state
>>> parsed_result[0].metadata is None
>>> parsed_result[1].metadata

This method must be implemented by classes based on this class.