diff --git a/pungi/scripts/gather_modules.py b/pungi/scripts/gather_modules.py index 1da8097a..4885f8ce 100644 --- a/pungi/scripts/gather_modules.py +++ b/pungi/scripts/gather_modules.py @@ -55,9 +55,11 @@ def collect_modules(modules_paths: List[BinaryIO], target_dir: str): path = os.path.join(module_defaults_path, name) logging.info('Found %s module defaults', name) else: + # pungi.phases.pkgset.sources.source_koji.get_koji_modules + stream = doc['data']['stream'].replace('-', '_') name = '%s-%s-%s.%s' % ( doc['data']['name'], - doc['data']['stream'], + stream, doc['data']['version'], doc['data']['context'] ) diff --git a/tests/test_gather_modules.py b/tests/test_gather_modules.py index 0a1cb856..4b683bfc 100644 --- a/tests/test_gather_modules.py +++ b/tests/test_gather_modules.py @@ -13,7 +13,7 @@ document: modulemd version: 2 data: name: mariadb-devel - stream: 10.3 + stream: 10.3-1 version: 8010020200108182321 context: cdc1202b arch: x86_64 @@ -103,7 +103,7 @@ class TestModulesYamlParser(TestCase): # check directory structure matches expected self.assertEqual([MODULES_YAML_GZ, 'modules', 'module_defaults'], os.listdir(PATH_TO_KOJI)) - self.assertEqual(['mariadb-devel-10.3-8010020200108182321.cdc1202b', + self.assertEqual(['mariadb-devel-10.3_1-8010020200108182321.cdc1202b', 'javapackages-tools-201801-8000020190628172923.b07bea58'], os.listdir(os.path.join(PATH_TO_KOJI, 'modules'))) self.assertEqual(['ant.yaml'], @@ -111,7 +111,7 @@ class TestModulesYamlParser(TestCase): # check that modules were exported self.assertEqual(MARIADB_MODULE, yaml.load( - open(os.path.join(PATH_TO_KOJI, 'modules', 'mariadb-devel-10.3-8010020200108182321.cdc1202b')))) + open(os.path.join(PATH_TO_KOJI, 'modules', 'mariadb-devel-10.3_1-8010020200108182321.cdc1202b')))) self.assertEqual(JAVAPACKAGES_TOOLS_MODULE, yaml.load( open(os.path.join(PATH_TO_KOJI, 'modules', 'javapackages-tools-201801-8000020190628172923.b07bea58'))))