From 324b371cff6a8d4dbc4bb09c4fd7b4bac0cd14d8 Mon Sep 17 00:00:00 2001 From: Mohan Boddu Date: Fri, 16 Nov 2018 19:16:46 -0500 Subject: [PATCH] Fix convert rpm_ostree config to YAML Merges: https://pagure.io/pungi/pull-request/1088 Signed-off-by: Mohan Boddu --- pungi/ostree/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pungi/ostree/utils.py b/pungi/ostree/utils.py index 817e74f3..0b74cb23 100644 --- a/pungi/ostree/utils.py +++ b/pungi/ostree/utils.py @@ -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: