add json and yaml components

This commit is contained in:
Louis Abel 2022-07-01 13:28:24 -07:00
parent e47ca962af
commit 412a7ab089
Signed by: label
GPG Key ID: B37E62D143879B36
2 changed files with 10 additions and 5 deletions

View File

@ -988,10 +988,10 @@ class RepoSync:
Shared.write_metadata(
self.timestamp,
self.date_stamp,
self.fullname,
self.distname,
self.fullversion,
self.compose_id,
metadata_dir + 'metadata.json'
metadata_dir + '/metadata'
)
self.log.info(

View File

@ -3,6 +3,7 @@
import os
import json
import hashlib
import yaml
import productmd.treeinfo
class ArchCheck:
@ -136,9 +137,13 @@ class Shared:
}
}
with open(file_path, "w+") as f:
json.dump(metadata, f)
f.close()
with open(file_path + ".json", "w+") as fp:
json.dump(metadata, fp, indent=4)
fp.close()
with open(file_path + ".yaml", "w+") as yp:
yaml.dump(metadata, yp)
yp.close()
@staticmethod
def discinfo_write(timestamp, fullname, arch, file_path):