diff --git a/module_build_service/builder/KojiContentGenerator.py b/module_build_service/builder/KojiContentGenerator.py index 227cbd9a..0e8928c6 100644 --- a/module_build_service/builder/KojiContentGenerator.py +++ b/module_build_service/builder/KojiContentGenerator.py @@ -47,12 +47,13 @@ class KojiContentGenerator(object): """ self.owner = module.owner self.module = module - self.module_str = module.name + self.module_name = module.name + self.mmd = module.modulemd self.config = config def __repr__(self): - return "" % (self.module_str) + return "" % (self.module_name) def _koji_rpms_in_tag(self, tag): """ Return the list of koji rpms in a tag. """ @@ -142,9 +143,9 @@ class KojiContentGenerator(object): 'buildroot_id': 1, 'arch': "noarch", 'type': 'modulemd', - 'filesize': len(self.module_str), + 'filesize': len(self.mmd), 'checksum_type': 'md5', - 'checksum': hashlib.md5(self.module_str).hexdigest(), + 'checksum': hashlib.md5(self.mmd).hexdigest(), 'filename': 'modulemd.yaml', 'components': components } diff --git a/tests/test_get_generator_json_expected_output.json b/tests/test_get_generator_json_expected_output.json index fb42631d..981e59c6 100644 --- a/tests/test_get_generator_json_expected_output.json +++ b/tests/test_get_generator_json_expected_output.json @@ -599,8 +599,8 @@ } ], "arch": "noarch", - "filesize": 5, - "checksum": "ee434023cf89d7dfb21f63d64f0f9d74", + "filesize": 1134, + "checksum": "bf1615b15f6a0fee485abe94af6b56b6", "checksum_type": "md5", "type": "modulemd" } @@ -615,7 +615,7 @@ "typeinfo": { "modulemd": { "module_build_service_id": 1, - "modulemd_str": "" + "modulemd_str": "# Document type identifier\ndocument: modulemd\n# Module metadata format version\nversion: 1\ndata:\n # Module name, optional\n # Typically filled in by the buildsystem, using the VCS repository\n # name as the name of the module.\n name: nginx\n # Module update stream, optional\n # Typically filled in by the buildsystem, using the VCS branch name\n # as the name of the stream.\n stream: 1\n # Module version, integer, optional, cannot be negative\n # Typically filled in by the buildsystem, using the VCS commit\n # timestamp. Module version defines upgrade path for the particular\n # update stream.\n version: 2\n # A short summary describing the module, required\n summary: An example nginx module\n # A verbose description of the module, required\n description: >\n A module for the tests of module build service\n # Module and content licenses in the Fedora license identifier\n # format, required\n license:\n # Module license, required\n # This list covers licenses used for the module metadata, SPEC\n # files or extra patches\n module:\n - MIT\n" } } },