From f38770c67d73ee30488a4011d8461bc8c252d4e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Fri, 6 Apr 2018 10:47:22 +0200 Subject: [PATCH] pkgset: Construct UID for PDC modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can't rely on the UID to be correctly joined with colons. There may be historical data that still uses dashes. Signed-off-by: Lubomír Sedlář --- pungi/phases/pkgset/sources/source_koji.py | 3 ++- tests/test_pkgset_source_koji.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pungi/phases/pkgset/sources/source_koji.py b/pungi/phases/pkgset/sources/source_koji.py index 65d0a407..5fa1fff3 100644 --- a/pungi/phases/pkgset/sources/source_koji.py +++ b/pungi/phases/pkgset/sources/source_koji.py @@ -254,7 +254,8 @@ def _get_modules_from_pdc(compose, session, variant, variant_tags): _add_module_to_variant(variant, mmd, pdc_module["rpms"]) tag = pdc_module["koji_tag"] - uid = pdc_module["variant_uid"] + uid = ':'.join([pdc_module['variant_name'], pdc_module['variant_version'], + pdc_module['variant_release'], pdc_module['variant_context']]) variant_tags[variant].append(tag) # Store mapping module-uid --> koji_tag into variant. diff --git a/tests/test_pkgset_source_koji.py b/tests/test_pkgset_source_koji.py index 7450a903..2126ee6b 100644 --- a/tests/test_pkgset_source_koji.py +++ b/tests/test_pkgset_source_koji.py @@ -142,7 +142,7 @@ data: - MIT """ - get_module.return_value = {'abc': 'def', 'modulemd': modulemd, 'rpms': [], 'koji_tag': 'taggg', 'variant_uid': 'modulenamefoo-rhel-1'} + get_module.return_value = {'abc': 'def', 'modulemd': modulemd, 'rpms': [], 'koji_tag': 'taggg', 'variant_uid': 'modulenamefoo-rhel-1', 'variant_name': 'modulenamefoo', 'variant_version': 'rhel', 'variant_release': '1', 'variant_context': '00000000'} for name, variant in self.compose.variants.items(): variant.get_modules = mock.MagicMock() if name == 'Server':