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( Shared.write_metadata(
self.timestamp, self.timestamp,
self.date_stamp, self.date_stamp,
self.fullname, self.distname,
self.fullversion, self.fullversion,
self.compose_id, self.compose_id,
metadata_dir + 'metadata.json' metadata_dir + '/metadata'
) )
self.log.info( self.log.info(

View File

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