diff --git a/pungi/wrappers/fus.py b/pungi/wrappers/fus.py index f3685ee9..df195067 100644 --- a/pungi/wrappers/fus.py +++ b/pungi/wrappers/fus.py @@ -83,5 +83,12 @@ def parse_output(output): packages.add((name, arch, frozenset(flags))) else: name, arch = nevra.rsplit(".", 1) - modules.add(name.split(":", 1)[1]) + # replace dash by underscore in stream of module's nerva + # source of name looks like + # module:llvm-toolset:rhel8:8040020210411062713:9f9e2e7e.x86_64 + name = ':'.join( + item.replace('-', '_') if i == 1 else item for + i, item in enumerate(name.split(':')[1:]) + ) + modules.add(name) return packages, modules diff --git a/tests/test_fus_wrapper.py b/tests/test_fus_wrapper.py index 2fccd44b..5f17a1ad 100644 --- a/tests/test_fus_wrapper.py +++ b/tests/test_fus_wrapper.py @@ -152,7 +152,10 @@ class TestParseOutput(unittest.TestCase): self.assertEqual(modules, set()) def test_extracts_modules(self): - touch(self.file, "module:mod:master:20181003:cafebeef.x86_64@repo-0\n") + touch( + self.file, + "module:mod:master-1:20181003:cafebeef.x86_64@repo-0\n" + ) packages, modules = fus.parse_output(self.file) self.assertEqual(packages, set()) - self.assertEqual(modules, set(["mod:master:20181003:cafebeef"])) + self.assertEqual(modules, set(["mod:master_1:20181003:cafebeef"]))