Fix convert rpm_ostree config to YAML

Merges: https://pagure.io/pungi/pull-request/1088
Signed-off-by: Mohan Boddu <mboddu@bhujji.com>
This commit is contained in:
Mohan Boddu 2018-11-16 19:16:46 -05:00 committed by Lubomír Sedlář
parent 07d08627c6
commit 324b371cff
1 changed files with 6 additions and 1 deletions

View File

@ -43,7 +43,12 @@ def get_ref_from_treefile(treefile, arch=None, logger=None):
if os.path.isfile(treefile):
with open(treefile, 'r') as f:
try:
parsed = json.loads(f.read())
# rpm-ostree now supports YAML
# https://github.com/projectatomic/rpm-ostree/pull/1377
if treefile.endswith(".yaml"):
parsed = yaml.safe_load(f)
else:
parsed = json.loads(f.read())
if arch is None:
basearch = getBaseArch()
else: