pkgset: Construct UID for PDC modules

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-04-06 10:47:22 +02:00
parent b3a3575ecf
commit f38770c67d
2 changed files with 3 additions and 2 deletions

View File

@ -254,7 +254,8 @@ def _get_modules_from_pdc(compose, session, variant, variant_tags):
_add_module_to_variant(variant, mmd, pdc_module["rpms"]) _add_module_to_variant(variant, mmd, pdc_module["rpms"])
tag = pdc_module["koji_tag"] 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) variant_tags[variant].append(tag)
# Store mapping module-uid --> koji_tag into variant. # Store mapping module-uid --> koji_tag into variant.

View File

@ -142,7 +142,7 @@ data:
- MIT - 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(): for name, variant in self.compose.variants.items():
variant.get_modules = mock.MagicMock() variant.get_modules = mock.MagicMock()
if name == 'Server': if name == 'Server':