From ebf028ca3b1c62bdb0e61c2c5ae4011ecc390af0 Mon Sep 17 00:00:00 2001 From: stepan_oksanichenko Date: Mon, 26 Apr 2021 23:18:29 +0300 Subject: [PATCH] LNX-286: Prepare pungi configuration and setup Jenkins job for AlmaLinux 8.4 beta - The modules from a parsend output of FUS should be have a stream with replaced dash by underscore @BS-NOBUILD @BS-TARGET-CL8 Change-Id: If36d3d0a1ef8010bf85a4a0218b9838e0888453c --- pungi/wrappers/fus.py | 9 ++++++++- tests/test_fus_wrapper.py | 7 +++++-- 2 files changed, 13 insertions(+), 3 deletions(-) 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"]))