mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-11 09:05:00 +08:00
Use modulemd.dump_all to create local repodata
Both pungi and dnf use the new multidocument format, with the old one not really being supported by anything at this point. Let's be compatible. This change requires modulemd-1.2.0+. Signed-off-by: Petr Šabata <contyk@redhat.com>
This commit is contained in:
@@ -26,6 +26,7 @@ import logging
|
||||
import os
|
||||
import koji
|
||||
import kobo.rpmlib
|
||||
import modulemd
|
||||
import shutil
|
||||
import yaml
|
||||
import threading
|
||||
@@ -163,12 +164,8 @@ mdpolicy=group:primary
|
||||
|
||||
# Generate the mmd the same way as pungi does.
|
||||
m1 = ModuleBuild.query.filter(ModuleBuild.name == self.module_str).one()
|
||||
modules = {"modules": []}
|
||||
modules["modules"].append(yaml.safe_load(m1.mmd().dumps()))
|
||||
mmd_path = os.path.join(path, "modules.yaml")
|
||||
|
||||
with open(mmd_path, "w") as outfile:
|
||||
outfile.write(yaml.safe_dump(modules))
|
||||
modulemd.dump_all(mmd_path, [ m1.mmd() ])
|
||||
|
||||
# Generate repo and inject modules.yaml there.
|
||||
execute_cmd(['/usr/bin/createrepo_c', path])
|
||||
|
||||
@@ -11,7 +11,7 @@ kobo
|
||||
m2crypto
|
||||
m2ext
|
||||
mock
|
||||
modulemd>=1.1.0,<2.0.0
|
||||
modulemd>=1.2.0,<2.0.0
|
||||
munch
|
||||
pdc-client
|
||||
pyOpenSSL
|
||||
|
||||
Reference in New Issue
Block a user