From f0cdb5030dca27765b0f3f9d95d363488d21c239 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Mon, 24 Sep 2018 09:45:43 +0200 Subject: [PATCH] Set modulemd 'arch' field in arch-specific modulemd files imported to CG build. --- module_build_service/builder/KojiContentGenerator.py | 3 +++ tests/test_content_generator.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/module_build_service/builder/KojiContentGenerator.py b/module_build_service/builder/KojiContentGenerator.py index 430d9d33..7b303ae7 100644 --- a/module_build_service/builder/KojiContentGenerator.py +++ b/module_build_service/builder/KojiContentGenerator.py @@ -20,6 +20,7 @@ # SOFTWARE. # # Written by Stanislav Ochotnicky +# Jan Kaluza import calendar @@ -546,6 +547,8 @@ class KojiContentGenerator(object): :return: Finalized modulemd string. """ mmd = self.module.mmd() + # Set the "Arch" field in mmd. + mmd.set_arch(pungi.arch.tree_arch_to_yum_arch(arch)) # Fill in the list of built RPMs. mmd = self._fill_in_rpms_list(mmd, arch) diff --git a/tests/test_content_generator.py b/tests/test_content_generator.py index 6d1d0e16..d24574b6 100644 --- a/tests/test_content_generator.py +++ b/tests/test_content_generator.py @@ -180,10 +180,10 @@ class TestBuild: assert len(mmd.read()) == 1134 with open(path.join(dir_path, "modulemd.x86_64.txt")) as mmd: - assert len(mmd.read()) == 242 + assert len(mmd.read()) == 257 with open(path.join(dir_path, "modulemd.i686.txt")) as mmd: - assert len(mmd.read()) == 242 + assert len(mmd.read()) == 255 @patch("module_build_service.builder.KojiContentGenerator.get_session") def test_tag_cg_build(self, get_session):