#572 Use modulemd.dump_all to create local repodata
Merged 6 years ago by psabata. Opened 6 years ago by psabata.
psabata/fm-orchestrator mmd-dump-all  into  master

@@ -26,6 +26,7 @@ 

  import os

  import koji

  import kobo.rpmlib

+ import modulemd

  import shutil

  import yaml

  import threading
@@ -163,12 +164,8 @@ 

  

          # 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])

file modified
+1 -1
@@ -11,7 +11,7 @@ 

  m2crypto

  m2ext

  mock

- modulemd>=1.1.0,<2.0.0

+ modulemd>=1.2.0,<2.0.0

  munch

  pdc-client

  pyOpenSSL

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

Pull-Request has been merged by psabata

6 years ago