diff --git a/insights/combiners/cryptsetup.py b/insights/combiners/cryptsetup.py index 0a6f478e5..717750738 100644 --- a/insights/combiners/cryptsetup.py +++ b/insights/combiners/cryptsetup.py @@ -8,6 +8,7 @@ import copy +from insights import SkipComponent from insights.core.plugins import combiner from insights.parsers.cryptsetup_luksDump import LuksDump from insights.parsers.luksmeta import LuksMeta @@ -50,3 +51,6 @@ def __init__(self, luks_dumps, luks_metas): luks_dump_copy["luksmeta"] = luksmeta_by_uuid[uuid] self.append(luks_dump_copy) + + if not self: + raise SkipComponent diff --git a/insights/tests/combiners/test_cryptsetup.py b/insights/tests/combiners/test_cryptsetup.py index c63a74cc6..389d3b886 100644 --- a/insights/tests/combiners/test_cryptsetup.py +++ b/insights/tests/combiners/test_cryptsetup.py @@ -1,5 +1,7 @@ import doctest +import pytest +from insights import SkipComponent from insights.parsers.cryptsetup_luksDump import LuksDump from insights.parsers import luksmeta from insights.combiners.cryptsetup import LuksDevices @@ -158,6 +160,9 @@ def test_luks_devices_combiner(): + with pytest.raises(SkipComponent): + luks_devices = LuksDevices([], None) + luks_devices = LuksDevices([luks1_device, luks2_device], None) for device in luks_devices: assert "luksmeta" not in device