From 3ab6d5cb715a35b6acd2fdaa385b106159d98b0d Mon Sep 17 00:00:00 2001 From: Mohan Boddu Date: Nov 17 2018 00:19:15 +0000 Subject: Fix convert rpm_ostree config to YAML Signed-off-by: Mohan Boddu --- diff --git a/pungi/ostree/utils.py b/pungi/ostree/utils.py index 817e74f..53d8358 100644 --- a/pungi/ostree/utils.py +++ b/pungi/ostree/utils.py @@ -43,7 +43,11 @@ 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: